zhiqiulin commited on
Commit
e570f26
·
verified ·
1 Parent(s): 4f4fc5a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -117,10 +117,10 @@ def load_example(model_name, images, prompt):
117
  with gr.Blocks() as demo_vqascore_ranking_beta:
118
  gr.Markdown("# VQAScore Ranking\nThis model ranks a gallery of images based on their similarity to a text prompt.")
119
  model_dropdown = gr.Dropdown(["clip-flant5-xl", "clip-flant5-xxl"], label="Model Name")
120
- gallery = gr.Gallery(label="Generated Images")
121
  prompt = gr.Textbox(label="Prompt")
122
  rank_button = gr.Button("Rank Images")
123
- ranked_gallery = gr.Gallery(label="Ranked Images with Scores")
124
 
125
  rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
126
 
@@ -135,6 +135,7 @@ with gr.Blocks() as demo_vqascore_ranking_beta:
135
  with gr.Row():
136
  gr.Column([model_dropdown, gallery, prompt, rank_button])
137
  gr.Column([example1_button, example2_button])
 
138
 
139
 
140
  # Combine the demos into a tabbed interface
 
117
  with gr.Blocks() as demo_vqascore_ranking_beta:
118
  gr.Markdown("# VQAScore Ranking\nThis model ranks a gallery of images based on their similarity to a text prompt.")
119
  model_dropdown = gr.Dropdown(["clip-flant5-xl", "clip-flant5-xxl"], label="Model Name")
120
+ gallery = gr.Gallery(label="Generated Images", elem_id="input-gallery").style(grid=(2, 2), height="200px")
121
  prompt = gr.Textbox(label="Prompt")
122
  rank_button = gr.Button("Rank Images")
123
+ ranked_gallery = gr.Gallery(label="Ranked Images with Scores", elem_id="ranked-gallery").style(grid=(2, 2), height="200px")
124
 
125
  rank_button.click(fn=rank_images, inputs=[model_dropdown, gallery, prompt], outputs=ranked_gallery)
126
 
 
135
  with gr.Row():
136
  gr.Column([model_dropdown, gallery, prompt, rank_button])
137
  gr.Column([example1_button, example2_button])
138
+
139
 
140
 
141
  # Combine the demos into a tabbed interface