Update app.py
Browse files
app.py
CHANGED
|
@@ -8,8 +8,8 @@ client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
| 8 |
|
| 9 |
|
| 10 |
def respond(message, history):
|
| 11 |
-
#responses = ["Yes", "No"]
|
| 12 |
-
#return random.choice(responses)
|
| 13 |
|
| 14 |
|
| 15 |
messages = [
|
|
@@ -23,7 +23,7 @@ def respond(message, history):
|
|
| 23 |
response = client.chat_completion(
|
| 24 |
messages, max_tokens = 100
|
| 25 |
)
|
| 26 |
-
return response['choices']
|
| 27 |
|
| 28 |
chatbot = gr.ChatInterface(respond, type="messages")
|
| 29 |
chatbot.launch()
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
def respond(message, history):
|
| 11 |
+
# responses = ["Yes", "No"]
|
| 12 |
+
# return random.choice(responses)
|
| 13 |
|
| 14 |
|
| 15 |
messages = [
|
|
|
|
| 23 |
response = client.chat_completion(
|
| 24 |
messages, max_tokens = 100
|
| 25 |
)
|
| 26 |
+
return response['choices'][0]['message']['content'].strip()
|
| 27 |
|
| 28 |
chatbot = gr.ChatInterface(respond, type="messages")
|
| 29 |
chatbot.launch()
|