Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ from huggingface_hub import InferenceClient
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import random
|
| 5 |
-
client=InferenceClient("
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
#responses = ["Yes", "No"]
|
|
@@ -17,7 +17,8 @@ def respond(message, history):
|
|
| 17 |
if history:
|
| 18 |
messages.extend(history)
|
| 19 |
|
| 20 |
-
response = client.chat_completion(messages, max_tokens=100)
|
|
|
|
| 21 |
|
| 22 |
return response["choices"][0]["message"]["content"].strip()
|
| 23 |
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import random
|
| 5 |
+
client=InferenceClient("Qwen/Qwen2.5-72B-Instruct")
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
#responses = ["Yes", "No"]
|
|
|
|
| 17 |
if history:
|
| 18 |
messages.extend(history)
|
| 19 |
|
| 20 |
+
response = client.chat_completion(messages, max_tokens=100, temperature=1.3, top_p=0.2)
|
| 21 |
+
# temperature and top_p control randomness
|
| 22 |
|
| 23 |
return response["choices"][0]["message"]["content"].strip()
|
| 24 |
|