HugoLaurencon ysharma HF staff commited on
Commit
f113dfb
β€’
1 Parent(s): 4e6fedf

added latest Gradio wheel (#22)

Browse files

- added latest Gradio wheel (663b96bc81057179fdcdb3412f9b0827619270a8)
- added visualization for image upload (5d6074c3a6edee08f99dd916bb597c128d024214)


Co-authored-by: yuvraj sharma <[email protected]>

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