zhiqiulin commited on
Commit
62ed9c9
1 Parent(s): 3e68751

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -132,7 +132,12 @@ def load_example(model_name, images, prompt):
132
 
133
  # Create the second demo: VQAScore Ranking
134
  with gr.Blocks() as demo_vqascore_ranking:
135
- gr.Markdown("# VQAScore Ranking\nThis model ranks a gallery of images based on their similarity to a text prompt.")
 
 
 
 
 
136
 
137
  with gr.Row():
138
  with gr.Column():
@@ -140,7 +145,6 @@ with gr.Blocks() as demo_vqascore_ranking:
140
  prompt = gr.Textbox(label="Prompt")
141
  gallery = gr.Gallery(label="Generated Images", elem_id="input-gallery", columns=4, allow_preview=True)
142
  rank_button = gr.Button("Rank Images")
143
- rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
144
 
145
  with gr.Column():
146
  example1_button = gr.Button("Load Example 1")
@@ -149,6 +153,8 @@ with gr.Blocks() as demo_vqascore_ranking:
149
  example2_button.click(fn=lambda: load_example("clip-flant5-xxl", example_imgs, example_prompt1), inputs=[], outputs=[model_dropdown, gallery, prompt])
150
 
151
  ranked_gallery = gr.Gallery(label="Ranked Images with Scores", elem_id="ranked-gallery", columns=4, allow_preview=True)
 
 
152
 
153
  # # Create the second demo
154
  # with gr.Blocks() as demo_vqascore_ranking:
 
132
 
133
  # Create the second demo: VQAScore Ranking
134
  with gr.Blocks() as demo_vqascore_ranking:
135
+ # gr.Markdown("# VQAScore Ranking\nThis model ranks a gallery of images based on their similarity to a text prompt.")
136
+ gr.Markdown("""
137
+ # VQAScore Ranking
138
+ This model ranks a gallery of images based on their similarity to a text prompt.
139
+ **Please retry if the model fails to load for the first time. Once the model is loaded to GPUs, the ranking process will be extremely fast.**
140
+ """)
141
 
142
  with gr.Row():
143
  with gr.Column():
 
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")
 
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
+
157
+ rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
158
 
159
  # # Create the second demo
160
  # with gr.Blocks() as demo_vqascore_ranking: