Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import random
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
def magic_response(message, history):
|
| 6 |
+
answers = [
|
| 7 |
+
"Its def likely!",
|
| 8 |
+
"Idk bro",
|
| 9 |
+
"Yes, obviously",
|
| 10 |
+
"Try again later",
|
| 11 |
+
"Signs point to no",
|
| 12 |
+
"Sure, why not?",
|
| 13 |
+
"Literally yes",
|
| 14 |
+
"This is unclear"
|
| 15 |
+
]
|
| 16 |
+
return random.choice(answers)
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
chat_ui = gr.ChatInterface(
|
| 20 |
+
fn=magic_response,
|
| 21 |
+
title="🎱 Ask the Future",
|
| 22 |
+
description="Type any yes/no question and receive your fate!",
|
| 23 |
+
theme="default",
|
| 24 |
+
type="messages"
|
| 25 |
+
)
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
chat_ui.launch()
|