Spaces:
Runtime error
Runtime error
Ray Leung
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,13 +19,15 @@ def create_playground_footer():
|
|
| 19 |
**To Learn More about 🤗 Hugging Face, [Click Here](https://huggingface.co/docs)**
|
| 20 |
""")
|
| 21 |
|
| 22 |
-
def create_tabs_header(topic,
|
| 23 |
with gr.Row():
|
| 24 |
with gr.Column(scale=4):
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
with gr.Column(scale=1):
|
| 30 |
test_pipeline_button = gr.Button(value="Process")
|
| 31 |
return test_pipeline_button
|
|
@@ -36,9 +38,10 @@ with playground:
|
|
| 36 |
with gr.TabItem("Image"):
|
| 37 |
|
| 38 |
topic = "Image Captioning"
|
| 39 |
-
|
|
|
|
| 40 |
"model: [Salesforce/blip-image-captioning-base](https://huggingface.co/Salesforce/blip-image-captioning-base)"]
|
| 41 |
-
image_pipeline_button = create_tabs_header(topic,
|
| 42 |
|
| 43 |
with gr.Row(visible=True) as use_pipeline:
|
| 44 |
with gr.Column():
|
|
|
|
| 19 |
**To Learn More about 🤗 Hugging Face, [Click Here](https://huggingface.co/docs)**
|
| 20 |
""")
|
| 21 |
|
| 22 |
+
def create_tabs_header(topic, description, references):
|
| 23 |
with gr.Row():
|
| 24 |
with gr.Column(scale=4):
|
| 25 |
+
reference_list = "> " + "\n> ".join(references)
|
| 26 |
+
gr.Markdown(f"""
|
| 27 |
+
## {topic}
|
| 28 |
+
### {description}
|
| 29 |
+
{reference_list}
|
| 30 |
+
""")
|
| 31 |
with gr.Column(scale=1):
|
| 32 |
test_pipeline_button = gr.Button(value="Process")
|
| 33 |
return test_pipeline_button
|
|
|
|
| 38 |
with gr.TabItem("Image"):
|
| 39 |
|
| 40 |
topic = "Image Captioning"
|
| 41 |
+
description = "Upload a image, check what AI understand and have vision on it."
|
| 42 |
+
references = ["category: Image-to-Text",
|
| 43 |
"model: [Salesforce/blip-image-captioning-base](https://huggingface.co/Salesforce/blip-image-captioning-base)"]
|
| 44 |
+
image_pipeline_button = create_tabs_header(topic, description, references)
|
| 45 |
|
| 46 |
with gr.Row(visible=True) as use_pipeline:
|
| 47 |
with gr.Column():
|