Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,11 +1,9 @@
|
|
| 1 |
-
from huggingface_hub import InferenceClient
|
| 2 |
import gradio as gr
|
|
|
|
| 3 |
|
| 4 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
def respond():
|
| 9 |
messages = [{"role": "system", "content": "You are a friendly chatbot."}]
|
| 10 |
if history:
|
| 11 |
messages.extend(history)
|
|
@@ -16,6 +14,6 @@ def respond():
|
|
| 16 |
)
|
| 17 |
return response['choices'][0]['message']['content'].strip()
|
| 18 |
|
| 19 |
-
chatbot = gr.ChatInterface(respond, type="messages"
|
| 20 |
|
| 21 |
chatbot.launch()
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from huggingface_hub import InferenceClient
|
| 3 |
|
| 4 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 5 |
|
| 6 |
+
def respond(message, history):
|
|
|
|
|
|
|
| 7 |
messages = [{"role": "system", "content": "You are a friendly chatbot."}]
|
| 8 |
if history:
|
| 9 |
messages.extend(history)
|
|
|
|
| 14 |
)
|
| 15 |
return response['choices'][0]['message']['content'].strip()
|
| 16 |
|
| 17 |
+
chatbot = gr.ChatInterface(respond, type="messages")
|
| 18 |
|
| 19 |
chatbot.launch()
|