Tesneem commited on
Commit
ae1744d
·
verified ·
1 Parent(s): 6ba5396

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -28,7 +28,7 @@ def generate_input(model, image=None, text=None):
28
  text_input = "No text provided."
29
 
30
  # Combine image caption and text output
31
- if image_caption and text_input!="No text provided.":
32
  # input = f"Image Caption: {image_caption}\nText Query: {text_output}"
33
  input = image_caption+" "+text_input
34
  elif image_caption:
@@ -65,7 +65,7 @@ with gr.Blocks() as demo:
65
  submit_button = gr.Button("Submit")
66
  output = gr.Textbox(label="Recommendations")
67
 
68
- submit_button.click(fn=generate_output, inputs=[image_input, text_input, sentence_model], outputs=output)
69
 
70
  demo.launch()
71
 
 
28
  text_input = "No text provided."
29
 
30
  # Combine image caption and text output
31
+ if image_caption and text:
32
  # input = f"Image Caption: {image_caption}\nText Query: {text_output}"
33
  input = image_caption+" "+text_input
34
  elif image_caption:
 
65
  submit_button = gr.Button("Submit")
66
  output = gr.Textbox(label="Recommendations")
67
 
68
+ submit_button.click(fn=generate_input, inputs=[image_input, text_input, sentence_model], outputs=output)
69
 
70
  demo.launch()
71