nightfury commited on
Commit
43fb827
1 Parent(s): 8104cb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -45,6 +45,8 @@ config.blip_num_beams = 64
45
  ci = Interrogator(config)
46
 
47
  def inference(image, mode, best_max_flavors):
 
 
48
  image = image.convert('RGB')
49
  if mode == 'best':
50
 
@@ -155,8 +157,8 @@ with gr.Blocks(css=css) as block:
155
  share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
156
 
157
  examples=[['eg1.jpeg', "best",4], ['eg2.jpeg',"fast",4]]
158
- #ex = gr.Examples(examples=examples, fn=inference, inputs=[input_image, mode_input, flavor_input], outputs=[output_text, share_button, community_icon, loading_icon], cache_examples=True, run_on_click=True)
159
- #ex.dataset.headers = [""]
160
 
161
  gr.HTML(article)
162
 
 
45
  ci = Interrogator(config)
46
 
47
  def inference(image, mode, best_max_flavors):
48
+ image = image.to(config.device)
49
+
50
  image = image.convert('RGB')
51
  if mode == 'best':
52
 
 
157
  share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
158
 
159
  examples=[['eg1.jpeg', "best",4], ['eg2.jpeg',"fast",4]]
160
+ ex = gr.Examples(examples=examples, fn=inference, inputs=[input_image, mode_input, flavor_input], outputs=[output_text, share_button, community_icon, loading_icon], cache_examples=True, run_on_click=True)
161
+ ex.dataset.headers = [""]
162
 
163
  gr.HTML(article)
164