Initial commit
This commit is contained in:
commit
6413436711
10
chat.py
Normal file
10
chat.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import requests
|
||||||
|
response = requests.post(
|
||||||
|
"http://ishangsf.com:11434/api/chat",
|
||||||
|
json={
|
||||||
|
"model": "deepseek-r1:14b",
|
||||||
|
"messages": [{"role": "user", "content": "你好!"}],
|
||||||
|
"stream": False
|
||||||
|
}
|
||||||
|
)
|
||||||
|
print(response.json()['message']['content'])
|
10
generate.py
Normal file
10
generate.py
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
import requests
|
||||||
|
|
||||||
|
url = "http://ishangsf.com:11434/api/generate"
|
||||||
|
payload = {
|
||||||
|
"model": "qwen2.5:latest",
|
||||||
|
"prompt": "你好,很高兴认识你。",
|
||||||
|
"stream": False
|
||||||
|
}
|
||||||
|
response = requests.post(url, json=payload)
|
||||||
|
print(response.json()['response'])
|
Loading…
x
Reference in New Issue
Block a user