Spaces:
Runtime error
Runtime error
Fixed application file
Browse files
app.py
CHANGED
|
@@ -1,21 +1,10 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
if
|
| 5 |
-
return "Yes"
|
| 6 |
else:
|
| 7 |
-
return "
|
| 8 |
|
| 9 |
-
gr.ChatInterface(
|
| 10 |
-
yes_man,
|
| 11 |
-
chatbot=gr.Chatbot(height=300),
|
| 12 |
-
textbox=gr.Textbox(placeholder="Ask me a yes or no question"),
|
| 13 |
-
title="Yes Man",
|
| 14 |
-
description="Ask Yes Man any question",
|
| 15 |
-
theme="soft",
|
| 16 |
-
examples=["Hello", "Am I cool?", "Are tomatoes vegetables?"],
|
| 17 |
-
cache_examples=True,
|
| 18 |
-
retry_btn=None,
|
| 19 |
-
undo_btn="Delete Previous",
|
| 20 |
-
clear_btn="Clear",
|
| 21 |
-
).launch()
|
|
|
|
| 1 |
+
import random
|
| 2 |
import gradio as gr
|
| 3 |
|
| 4 |
+
def alternatingly_agree(message, history):
|
| 5 |
+
if len(history) % 2 == 0:
|
| 6 |
+
return f"Yes, I do think that '{message}'"
|
| 7 |
else:
|
| 8 |
+
return "I don't think so"
|
| 9 |
|
| 10 |
+
gr.ChatInterface(alternatingly_agree).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|