chats-bug commited on
Commit
8b1e86b
·
1 Parent(s): 0d08077

Fixed multiple captioning output

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -40,7 +40,8 @@ inputs = [
40
  gr.inputs.Number(default=50, label="Maximum Caption Length"),
41
  gr.inputs.Number(default=1, label="Number of Captions to Generate"),
42
  ]
43
- outputs = gr.outputs.Textbox()
 
44
 
45
  title = "Git-Base-COCO Image Captioning"
46
  description = "A model for generating captions for images."
@@ -51,4 +52,5 @@ gr.Interface(
51
  outputs=outputs,
52
  title=title,
53
  description=description,
54
- ).launch()
 
 
40
  gr.inputs.Number(default=50, label="Maximum Caption Length"),
41
  gr.inputs.Number(default=1, label="Number of Captions to Generate"),
42
  ]
43
+ # Determine the number of outputs based on the number of captions to generate.
44
+ outputs = [gr.outputs.Textbox(label=f"Caption {i+1}") for i in range(inputs[2].default)]
45
 
46
  title = "Git-Base-COCO Image Captioning"
47
  description = "A model for generating captions for images."
 
52
  outputs=outputs,
53
  title=title,
54
  description=description,
55
+ enable_queue=True,
56
+ ).launch(debug=True)