Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,13 +3,13 @@ from huggingface_hub import InferenceClient
|
|
| 3 |
|
| 4 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 5 |
|
| 6 |
-
def respond(message, history):
|
| 7 |
|
| 8 |
messages = []
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
| 12 |
-
|
| 13 |
messages.append({"role": "user", "content": message})
|
| 14 |
|
| 15 |
response = client.chat_completion(
|
|
@@ -19,6 +19,6 @@ def respond(message, history):
|
|
| 19 |
|
| 20 |
return response['choices'][0]['message']['content'].strip()
|
| 21 |
|
| 22 |
-
|
| 23 |
|
| 24 |
-
|
|
|
|
| 3 |
|
| 4 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 5 |
|
| 6 |
+
def respond(message, history):
|
| 7 |
|
| 8 |
messages = []
|
| 9 |
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
| 12 |
+
|
| 13 |
messages.append({"role": "user", "content": message})
|
| 14 |
|
| 15 |
response = client.chat_completion(
|
|
|
|
| 19 |
|
| 20 |
return response['choices'][0]['message']['content'].strip()
|
| 21 |
|
| 22 |
+
demo = gr.ChatInterface(respond, type="messages")
|
| 23 |
|
| 24 |
+
demo.launch()
|