Spaces:
Runtime error
Runtime error
Update app_dialogue.py
Browse files- app_dialogue.py +7 -3
app_dialogue.py
CHANGED
@@ -103,7 +103,10 @@ def pil_to_temp_file(img: PIL.Image.Image, dir: str = DEFAULT_TEMP_DIR, format:
|
|
103 |
def add_file(file):
|
104 |
print("****** add_file *******")
|
105 |
print(f"returns - file name - {file.name}")
|
106 |
-
return file.name
|
|
|
|
|
|
|
107 |
|
108 |
|
109 |
# Utils to handle the image markdown display logic
|
@@ -716,8 +719,9 @@ with gr.Blocks(title="IDEFICS Playground", theme=gr.themes.Base()) as demo:
|
|
716 |
],
|
717 |
)
|
718 |
|
719 |
-
upload_btn.upload(add_file, [upload_btn], [imagebox], queue=False)
|
720 |
-
upload_btn.upload(
|
|
|
721 |
submit_btn.click(lambda : gr.update(label='๐ Upload image', interactive=True), [], upload_btn)
|
722 |
textbox.submit(lambda : gr.update(label='๐ Upload image', interactive=True), [], upload_btn)
|
723 |
clear_btn.click(lambda : gr.update(label='๐ Upload image', interactive=True), [], upload_btn)
|
|
|
103 |
def add_file(file):
|
104 |
print("****** add_file *******")
|
105 |
print(f"returns - file name - {file.name}")
|
106 |
+
return file.name, gr.update(label='๐ผ๏ธ Uploaded!', interactive=False)
|
107 |
+
|
108 |
+
#upload_btn.upload(add_file, [upload_btn], [imagebox, upload_btn], queue=False)
|
109 |
+
#upload_btn.upload(lambda : gr.update(label='๐ผ๏ธ Uploaded!', interactive=False), [], upload_btn)
|
110 |
|
111 |
|
112 |
# Utils to handle the image markdown display logic
|
|
|
719 |
],
|
720 |
)
|
721 |
|
722 |
+
#upload_btn.upload(add_file, [upload_btn], [imagebox], queue=False)
|
723 |
+
upload_btn.upload(add_file, [upload_btn], [imagebox, upload_btn], queue=False)
|
724 |
+
#upload_btn.upload(lambda : gr.update(label='๐ผ๏ธ Uploaded!', interactive=False), [], upload_btn)
|
725 |
submit_btn.click(lambda : gr.update(label='๐ Upload image', interactive=True), [], upload_btn)
|
726 |
textbox.submit(lambda : gr.update(label='๐ Upload image', interactive=True), [], upload_btn)
|
727 |
clear_btn.click(lambda : gr.update(label='๐ Upload image', interactive=True), [], upload_btn)
|