aliabid94 HF Staff commited on
Commit
e37e23c
·
1 Parent(s): e433904

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +7 -11
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
- file = gr.File(file_count="multiple")
14
- zipped = gr.File()
15
- file.change(zip_files, file, zipped)
 
 
 
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()