Spaces:
No application file
No application file
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,13 +6,11 @@ from transformers.utils import logging
|
|
| 6 |
logging.set_verbosity_error()
|
| 7 |
|
| 8 |
import warnings
|
| 9 |
-
warnings.filterwarnings("ignore",
|
| 10 |
-
message="Using the model-agnostic default `max_length`")
|
| 11 |
import os
|
| 12 |
import gradio as gr
|
| 13 |
from transformers import pipeline
|
| 14 |
-
pipe = pipeline("image-to-text"
|
| 15 |
-
model="Salesforce/blip-image-captioning-base")
|
| 16 |
def launch(input):
|
| 17 |
out = pipe(input)
|
| 18 |
return out[0]['generated_text']
|
|
|
|
| 6 |
logging.set_verbosity_error()
|
| 7 |
|
| 8 |
import warnings
|
| 9 |
+
warnings.filterwarnings("ignore",message="Using the model-agnostic default `max_length`")
|
|
|
|
| 10 |
import os
|
| 11 |
import gradio as gr
|
| 12 |
from transformers import pipeline
|
| 13 |
+
pipe = pipeline("image-to-text,model="Salesforce/blip-image-captioning-base")
|
|
|
|
| 14 |
def launch(input):
|
| 15 |
out = pipe(input)
|
| 16 |
return out[0]['generated_text']
|