Spaces:
Runtime error
Runtime error
messages to message
Browse files
app.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 4 |
-
def
|
| 5 |
|
| 6 |
messages = [{'role': "system", "content":"your are a friend chatbot"}]
|
| 7 |
if history:
|
|
@@ -15,5 +15,5 @@ def genrespond(message,history):
|
|
| 15 |
)
|
| 16 |
return response['choices'][0]['message']['content'].strip()
|
| 17 |
|
| 18 |
-
chatbot = gr.ChatInterface(
|
| 19 |
chatbot.launch(debug=True)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from huggingface_hub import InferenceClient
|
| 3 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
| 4 |
+
def respond(message,history):
|
| 5 |
|
| 6 |
messages = [{'role': "system", "content":"your are a friend chatbot"}]
|
| 7 |
if history:
|
|
|
|
| 15 |
)
|
| 16 |
return response['choices'][0]['message']['content'].strip()
|
| 17 |
|
| 18 |
+
chatbot = gr.ChatInterface(respond, type='message')
|
| 19 |
chatbot.launch(debug=True)
|