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