Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
|
6 |
# Load model and processor
|
7 |
model_id = "cosmo3769/finetuned_paligemma_vqav2_small"
|
8 |
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
|
9 |
-
processor =
|
10 |
|
11 |
# Define inference function
|
12 |
def process_image(image, prompt):
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import AutoProcessor, PaliGemmaForConditionalGeneration
|
3 |
from PIL import Image
|
4 |
import torch
|
5 |
|
6 |
# Load model and processor
|
7 |
model_id = "cosmo3769/finetuned_paligemma_vqav2_small"
|
8 |
model = PaliGemmaForConditionalGeneration.from_pretrained(model_id)
|
9 |
+
processor = AutoProcessor.from_pretrained("google/paligemma-3b-pt-224")
|
10 |
|
11 |
# Define inference function
|
12 |
def process_image(image, prompt):
|