Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,15 +2,8 @@ import os
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
| 5 |
-
# # Initialize the pipeline with the image-to-text model
|
| 6 |
-
# model_path = "Salesforce/blip-image-captioning-base"
|
| 7 |
-
|
| 8 |
-
# if not os.path.exists(model_path):
|
| 9 |
-
# raise FileNotFoundError(f"Model path {model_path} does not exist. Please provide a valid path.")
|
| 10 |
-
|
| 11 |
# Initialize the image-to-text pipeline with the specified model
|
| 12 |
pipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
| 13 |
-
#pipe = pipeline("image-to-text", model=model_path)
|
| 14 |
|
| 15 |
def launch(input):
|
| 16 |
"""
|
|
|
|
| 2 |
import gradio as gr
|
| 3 |
from transformers import pipeline
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
# Initialize the image-to-text pipeline with the specified model
|
| 6 |
pipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
|
|
|
| 7 |
|
| 8 |
def launch(input):
|
| 9 |
"""
|