Update run.py
Browse files
run.py
CHANGED
|
@@ -1,19 +1,15 @@
|
|
| 1 |
import os
|
| 2 |
-
from zipfile import ZipFile
|
| 3 |
import gradio as gr
|
| 4 |
|
| 5 |
-
|
| 6 |
-
def zip_files(files):
|
| 7 |
-
with ZipFile("tmp.zip", "w") as zipObj:
|
| 8 |
-
for idx, file in enumerate(files):
|
| 9 |
-
zipObj.write(file.name, file.name.split("/")[-1])
|
| 10 |
-
return "tmp.zip"
|
| 11 |
-
|
| 12 |
with gr.Blocks() as demo:
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
|
|
|
|
|
|
|
|
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
if __name__ == "__main__":
|
| 19 |
demo.launch()
|
|
|
|
| 1 |
import os
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
with gr.Blocks() as demo:
|
| 5 |
+
chat = gr.Chatbot()
|
| 6 |
+
text = gr.Textbox()
|
| 7 |
+
|
| 8 |
+
def add_message(chat, msg):
|
| 9 |
+
chat.append([msg, msg])
|
| 10 |
+
return chat
|
| 11 |
|
| 12 |
+
text.submit(add_message, [chat, text], chat)
|
| 13 |
|
| 14 |
if __name__ == "__main__":
|
| 15 |
demo.launch()
|