aavetis commited on
Commit
4e87b4a
1 Parent(s): 109b906

adding context to description, pre-populate prompt

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -28,10 +28,15 @@ def generate_caption(image, prompt):
28
  return decoded_text
29
 
30
  # Define the Gradio interface
 
 
 
 
31
  iface = gr.Interface(
32
  fn=generate_caption,
33
- inputs=[gr.Image(type="pil", label="Upload Image"), gr.Textbox(label="Prompt")],
34
  outputs=gr.Textbox(label="Generated Caption"),
 
35
  )
36
 
37
  # Launch the interface
 
28
  return decoded_text
29
 
30
  # Define the Gradio interface
31
+ description = """Quick demonstration of the new Unum uForm-gen for image captioning. Upload an image to generate a detailed caption. Modify the Prompt to change the level of detail in the caption.
32
+
33
+ The model used in this app is available at [Hugging Face Model Hub](https://huggingface.co/unum-cloud/uform-gen) and the source code can be found on [GitHub](https://github.com/unum-cloud/uform)."""
34
+
35
  iface = gr.Interface(
36
  fn=generate_caption,
37
+ inputs=[gr.Image(type="pil", label="Upload Image"), gr.Textbox(label="Prompt", value="Describe the image in great detail")],
38
  outputs=gr.Textbox(label="Generated Caption"),
39
+ description=description
40
  )
41
 
42
  # Launch the interface