victorgg commited on
Commit
912cc61
·
verified ·
1 Parent(s): d5bcc43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -41,12 +41,13 @@ def generate_caption(image):
41
  print("\n\nGeneration completed!:", prompt)
42
  return prompt
43
 
44
- # Create Gradio Interface
45
  io = gr.Interface(
46
  fn=generate_caption,
47
  inputs=[gr.Image(label="Input Image")],
48
- outputs=[gr.Textbox(label="Generated Caption", lines=2, show_copy_button=True)]
 
49
  )
50
 
51
- # Launch the app
52
- io.launch(debug=True)
 
41
  print("\n\nGeneration completed!:", prompt)
42
  return prompt
43
 
44
+ # Create Gradio Interface with HTTP API endpoint
45
  io = gr.Interface(
46
  fn=generate_caption,
47
  inputs=[gr.Image(label="Input Image")],
48
+ outputs=[gr.Textbox(label="Generated Caption", lines=2, show_copy_button=True)],
49
+ live=True
50
  )
51
 
52
+ # Launch the app with API mode enabled
53
+ io.launch(share=True, server_name="0.0.0.0", server_port=7860, debug=True)