zhiqiulin commited on
Commit
d227cb9
1 Parent(s): aa1a306

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -143,8 +143,8 @@ with gr.Blocks() as demo_vqascore_ranking:
143
  with gr.Column():
144
  model_dropdown = gr.Dropdown(["clip-flant5-xxl", "clip-flant5-xl"], value="clip-flant5-xxl", label="Model Name")
145
  prompt = gr.Textbox(label="Prompt")
146
- gallery = gr.Gallery(label="Generated Images", elem_id="input-gallery", columns=4, allow_preview=True)
147
- rank_button = gr.Button("Rank Images")
148
 
149
  with gr.Column():
150
  example1_button = gr.Button("Load Example 1")
@@ -152,7 +152,7 @@ with gr.Blocks() as demo_vqascore_ranking:
152
  example1_button.click(fn=lambda: load_example("clip-flant5-xxl", example_imgs, example_prompt0), inputs=[], outputs=[model_dropdown, gallery, prompt])
153
  example2_button.click(fn=lambda: load_example("clip-flant5-xxl", example_imgs, example_prompt1), inputs=[], outputs=[model_dropdown, gallery, prompt])
154
 
155
- ranked_gallery = gr.Gallery(label="Ranked Images with Scores", elem_id="ranked-gallery", columns=4, allow_preview=True)
156
  rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
157
 
158
  # # Create the second demo
 
143
  with gr.Column():
144
  model_dropdown = gr.Dropdown(["clip-flant5-xxl", "clip-flant5-xl"], value="clip-flant5-xxl", label="Model Name")
145
  prompt = gr.Textbox(label="Prompt")
146
+ gallery = gr.Gallery(label="Input Image(s)", elem_id="input-gallery", columns=4, allow_preview=True)
147
+ rank_button = gr.Button("Submit")
148
 
149
  with gr.Column():
150
  example1_button = gr.Button("Load Example 1")
 
152
  example1_button.click(fn=lambda: load_example("clip-flant5-xxl", example_imgs, example_prompt0), inputs=[], outputs=[model_dropdown, gallery, prompt])
153
  example2_button.click(fn=lambda: load_example("clip-flant5-xxl", example_imgs, example_prompt1), inputs=[], outputs=[model_dropdown, gallery, prompt])
154
 
155
+ ranked_gallery = gr.Gallery(label="Output: Ranked Images with Scores", elem_id="ranked-gallery", columns=4, allow_preview=True)
156
  rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
157
 
158
  # # Create the second demo