Tonic commited on
Commit
6889a60
1 Parent(s): 98d13ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -49,13 +49,19 @@ with gr.Blocks() as demo:
49
  prompt_input_custom = gr.Textbox(label="Enter your custom prompt")
50
  generate_button_custom = gr.Button("Generate")
51
  output_text_custom = gr.Textbox(label="Response")
52
- generate_button_custom.click(fn=generate, inputs=[image_input_custom, prompt_input_custom], outputs=output_text_custom)
 
 
 
 
 
53
  example_prompt = "65 y/m Chronic cough and weight loss x 6 months. Chest X-rays normal. Consulted multiple pulmonologists with not much benefit. One wise pulmonologist thinks of GERD and sends him to the Gastro department. Can you name the classical finding here?"
54
  example_image_path = os.path.join(os.path.dirname(__file__), "hegde.jpg")
55
  gr.Examples(
56
  examples=[[example_image_path, example_prompt]],
57
  inputs=[image_input_custom, prompt_input_custom],
58
  outputs=[output_text_custom],
 
59
  cache_examples=True
60
  )
61
 
 
49
  prompt_input_custom = gr.Textbox(label="Enter your custom prompt")
50
  generate_button_custom = gr.Button("Generate")
51
  output_text_custom = gr.Textbox(label="Response")
52
+
53
+ def custom_generate(image, prompt):
54
+ return generate(image, prompt)
55
+
56
+ generate_button_custom.click(fn=custom_generate, inputs=[image_input_custom, prompt_input_custom], outputs=output_text_custom)
57
+
58
  example_prompt = "65 y/m Chronic cough and weight loss x 6 months. Chest X-rays normal. Consulted multiple pulmonologists with not much benefit. One wise pulmonologist thinks of GERD and sends him to the Gastro department. Can you name the classical finding here?"
59
  example_image_path = os.path.join(os.path.dirname(__file__), "hegde.jpg")
60
  gr.Examples(
61
  examples=[[example_image_path, example_prompt]],
62
  inputs=[image_input_custom, prompt_input_custom],
63
  outputs=[output_text_custom],
64
+ fn=custom_generate,
65
  cache_examples=True
66
  )
67