Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,15 +22,15 @@ def respond(message, history):
|
|
| 22 |
# temp = between 0-2
|
| 23 |
# top-p = between 0-1
|
| 24 |
):
|
| 25 |
-
token =
|
| 26 |
if token:
|
| 27 |
response += token
|
| 28 |
yield response
|
| 29 |
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
|
| 35 |
chatbot = gr.ChatInterface(respond, type = "messages")
|
| 36 |
|
|
|
|
| 22 |
# temp = between 0-2
|
| 23 |
# top-p = between 0-1
|
| 24 |
):
|
| 25 |
+
token = message.choices[0].delta.content
|
| 26 |
if token:
|
| 27 |
response += token
|
| 28 |
yield response
|
| 29 |
|
| 30 |
+
def random_message(message, history):
|
| 31 |
+
choices = ["it is likely", "absolutely not", "try again", "without a doubt", "outlook good", "signs point to it", "very unlikely", "quite doubtful"]
|
| 32 |
+
chat_answer = random.choice(choices)
|
| 33 |
+
return chat_answer
|
| 34 |
|
| 35 |
chatbot = gr.ChatInterface(respond, type = "messages")
|
| 36 |
|