aisltnab commited on
Commit
3dd561a
·
1 Parent(s): 9cc46a4

Update run.py

Browse files
Files changed (1) hide show
  1. run.py +11 -6
run.py CHANGED
@@ -1,12 +1,17 @@
1
  import gradio as gr
2
 
3
- def upload_file(files):
4
- file_paths = [file.name for file in files]
5
- return file_paths
 
 
 
6
 
 
 
 
7
  with gr.Blocks() as demo:
8
- file_output = gr.File()
9
- upload_button = gr.UploadButton("Click to Upload an Image or Video File", file_types=["image", "video"], file_count="multiple")
10
- upload_button.upload(upload_file, upload_button, file_output)
11
 
12
  demo.launch()
 
1
  import gradio as gr
2
 
3
+ def add_file(history, task_history, file):
4
+ history = history + [((file.name,), None)]
5
+ task_history = task_history + [((file.name,), None)]
6
+ print(history)
7
+ print(task_history)
8
+ return history, task_history
9
 
10
+
11
+ chatbot = []
12
+ task_history = []
13
  with gr.Blocks() as demo:
14
+ addfile_btn = gr.UploadButton("Upload", file_types=["image"])
15
+ addfile_btn.upload(add_file, [chatbot, task_history, addfile_btn], [chatbot, task_history], show_progress=True)
 
16
 
17
  demo.launch()