Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,16 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
3 |
-
import torch
|
4 |
|
5 |
-
|
6 |
-
model = AutoModelForImageTextToText.from_pretrained("HuggingFaceTB/SmolVLM2-2.2B-Instruct")
|
7 |
-
|
8 |
-
model_path = "HuggingFaceTB/SmolVLM2-2.2B-Instruct"
|
9 |
-
processor = AutoProcessor.from_pretrained(model_path)
|
10 |
|
11 |
def launch(input):
|
12 |
-
out =
|
13 |
-
return
|
14 |
|
15 |
iface = gr.Interface(launch,
|
16 |
inputs=gr.Image(type='pil'),
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import pipeline
|
|
|
3 |
|
4 |
+
pipe = pipeline("image-to-text", model="Salesforce/blip-image-captioning-base")
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def launch(input):
|
7 |
+
out = pipe(input)
|
8 |
+
return out[0]['generated_text']
|
9 |
|
10 |
iface = gr.Interface(launch,
|
11 |
inputs=gr.Image(type='pil'),
|