added latest Gradio wheel

#22
by ysharma HF staff - opened
Files changed (2) hide show
  1. app_dialogue.py +7 -4
  2. requirements.txt +1 -1
app_dialogue.py CHANGED
@@ -96,8 +96,8 @@ def pil_to_temp_file(img: PIL.Image.Image, dir: str = DEFAULT_TEMP_DIR, format:
96
 
97
 
98
  def add_file(file):
99
- return file.name
100
-
101
 
102
  # This is a hack to make pre-computing the default examples work.
103
  # During normal inference, we pass images as url to a local file using the method `gradio_link`
@@ -702,8 +702,11 @@ with gr.Blocks(title="IDEFICS Playground", theme=gr.themes.Base()) as demo:
702
  ],
703
  )
704
 
705
- upload_btn.upload(add_file, [upload_btn], [imagebox], queue=False)
706
-
 
 
 
707
  # Using Flagging for saving dope and problematic examples
708
  # Dope examples flagging
709
  # dope_callback.setup(
 
96
 
97
 
98
  def add_file(file):
99
+ return file.name, gr.update(label='🖼️ Uploaded!')
100
+
101
 
102
  # This is a hack to make pre-computing the default examples work.
103
  # During normal inference, we pass images as url to a local file using the method `gradio_link`
 
702
  ],
703
  )
704
 
705
+ upload_btn.upload(add_file, [upload_btn], [imagebox, upload_btn], queue=False)
706
+ submit_btn.click(lambda : gr.update(label='📁 Upload image', interactive=True), [], upload_btn)
707
+ textbox.submit(lambda : gr.update(label='📁 Upload image', interactive=True), [], upload_btn)
708
+ clear_btn.click(lambda : gr.update(label='📁 Upload image', interactive=True), [], upload_btn)
709
+
710
  # Using Flagging for saving dope and problematic examples
711
  # Dope examples flagging
712
  # dope_callback.setup(
requirements.txt CHANGED
@@ -16,4 +16,4 @@ pynvml
16
  sentencepiece
17
  text_generation
18
  gradio-client @ git+https://github.com/gradio-app/gradio@bd4570ed4343f75a7ae335ef06d5eb313d107bc9#subdirectory=client/python
19
- https://gradio-builds.s3.amazonaws.com/072363ccd439a89865913825705babceb792fc45/gradio-3.40.1-py3-none-any.whl
 
16
  sentencepiece
17
  text_generation
18
  gradio-client @ git+https://github.com/gradio-app/gradio@bd4570ed4343f75a7ae335ef06d5eb313d107bc9#subdirectory=client/python
19
+ https://gradio-main-build.s3.amazonaws.com/92282cea6afdf7e9930ece1046d8a63be34b3cea/gradio-3.40.1-py3-none-any.whl