Spaces:
Runtime error
Runtime error
40226743 commited on
Commit ·
5cefa6b
1
Parent(s): c5f6e51
Updated app.py
Browse files
app.py
CHANGED
|
@@ -34,4 +34,32 @@ def predict(input, chat_history_ids=chat_history_ids, step=step):
|
|
| 34 |
return output
|
| 35 |
|
| 36 |
|
| 37 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
return output
|
| 35 |
|
| 36 |
|
| 37 |
+
demo = gr.Blocks()
|
| 38 |
+
|
| 39 |
+
with demo:
|
| 40 |
+
gr.Markdown(
|
| 41 |
+
"""
|
| 42 |
+
<center>
|
| 43 |
+
<img src="https://media3.giphy.com/media/l0amJzVHIAfl7jMDos/giphy.gif" alt="dialog" width="250" height="250">
|
| 44 |
+
|
| 45 |
+
## Speak with Michael by typing in the input box below.
|
| 46 |
+
</center>
|
| 47 |
+
"""
|
| 48 |
+
)
|
| 49 |
+
|
| 50 |
+
with gr.Row():
|
| 51 |
+
with gr.Column():
|
| 52 |
+
inp = gr.Textbox(
|
| 53 |
+
label="Enter text to converse with Michael here:",
|
| 54 |
+
lines=1,
|
| 55 |
+
max_lines=1,
|
| 56 |
+
value="Wow this is hard",
|
| 57 |
+
placeholder="What do you think of Toby?",
|
| 58 |
+
)
|
| 59 |
+
btn = gr.Button("Submit")
|
| 60 |
+
out = gr.Textbox(lines=3)
|
| 61 |
+
# btn = gr.Button("Submit")
|
| 62 |
+
inp.submit(fn=predict, inputs=inp, outputs=out)
|
| 63 |
+
btn.click(fn=predict, inputs=inp, outputs=out)
|
| 64 |
+
|
| 65 |
+
demo.launch()
|