Spaces:
Runtime error
Runtime error
adding context to description, pre-populate prompt
Browse files
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
|