Spaces:
Build error
Build error
Update run.py
Browse files
run.py
CHANGED
|
@@ -1,12 +1,17 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
|
| 3 |
-
def
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
|
|
|
|
|
|
|
|
|
|
| 7 |
with gr.Blocks() as demo:
|
| 8 |
-
|
| 9 |
-
|
| 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()
|