Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,19 +2,19 @@ from huggingface_hub import InferenceClient
|
|
| 2 |
import gradio as gr
|
| 3 |
import random
|
| 4 |
|
| 5 |
-
client = InferenceClient("
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
messages = [
|
| 9 |
{"role":"system",
|
| 10 |
-
'content':'You are a
|
| 11 |
}
|
| 12 |
]
|
| 13 |
if history:
|
| 14 |
messages.extend(history)
|
| 15 |
|
| 16 |
response = client.chat_completion(
|
| 17 |
-
messages, max_tokens = 100
|
| 18 |
)
|
| 19 |
return response['choices'][0]['message']['content'].strip()
|
| 20 |
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
import random
|
| 4 |
|
| 5 |
+
client = InferenceClient("Qwen/Qwen2.5-72B-Instruct")
|
| 6 |
|
| 7 |
def respond(message, history):
|
| 8 |
messages = [
|
| 9 |
{"role":"system",
|
| 10 |
+
'content':'You are a chatbot that loves talking about crocheting.'
|
| 11 |
}
|
| 12 |
]
|
| 13 |
if history:
|
| 14 |
messages.extend(history)
|
| 15 |
|
| 16 |
response = client.chat_completion(
|
| 17 |
+
messages, max_tokens = 100, temperature=1.3, top_p=0.6
|
| 18 |
)
|
| 19 |
return response['choices'][0]['message']['content'].strip()
|
| 20 |
|