Spaces:
Runtime error
Runtime error
Commit
·
daa9e93
1
Parent(s):
099180b
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
-
from transformers import AutoProcessor,
|
| 4 |
import os
|
| 5 |
-
processor = AutoProcessor.from_pretrained("shadowlilac/visor
|
| 6 |
-
model =
|
| 7 |
|
| 8 |
def generate_caption(image):
|
| 9 |
raw_image = Image.fromarray(image)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from PIL import Image
|
| 3 |
+
from transformers import AutoProcessor, BlipForConditionalGeneration
|
| 4 |
import os
|
| 5 |
+
processor = AutoProcessor.from_pretrained("shadowlilac/visor", token=os.getenv('HUGGING_FACE_HUB_TOKEN'))
|
| 6 |
+
model = BlipForConditionalGeneration.from_pretrained("shadowlilac/visor", ignore_mismatched_sizes=True, token=os.getenv('HUGGING_FACE_HUB_TOKEN'))
|
| 7 |
|
| 8 |
def generate_caption(image):
|
| 9 |
raw_image = Image.fromarray(image)
|