Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,7 @@ model = BlipForConditionalGeneration.from_pretrained(model_id).to(device)
|
|
19 |
|
20 |
def run(image: PIL.Image.Image) -> str:
|
21 |
inputs = processor(images=image, return_tensors="pt").to(device)
|
22 |
-
out = model.generate(pixel_values=pixel_values, max_length=300)
|
23 |
generated_caption = processor.decode(out[0], skip_special_tokens=True)
|
24 |
return generated_caption
|
25 |
|
|
|
19 |
|
20 |
def run(image: PIL.Image.Image) -> str:
|
21 |
inputs = processor(images=image, return_tensors="pt").to(device)
|
22 |
+
out = model.generate(pixel_values=inputs.pixel_values, max_length=300)
|
23 |
generated_caption = processor.decode(out[0], skip_special_tokens=True)
|
24 |
return generated_caption
|
25 |
|