Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ def predict(image):
|
|
30 |
inputs = processor(images=image, return_tensors="pt").to(device, torch.float16)
|
31 |
new_eos_token_id = 13
|
32 |
with torch.no_grad():
|
33 |
-
generated_ids =
|
34 |
eos_token_id=new_eos_token_id)
|
35 |
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
36 |
return f"{generated_caption[0]}"
|
|
|
30 |
inputs = processor(images=image, return_tensors="pt").to(device, torch.float16)
|
31 |
new_eos_token_id = 13
|
32 |
with torch.no_grad():
|
33 |
+
generated_ids = model.generate(**inputs, max_length=100,
|
34 |
eos_token_id=new_eos_token_id)
|
35 |
generated_caption = processor.batch_decode(generated_ids, skip_special_tokens=True)
|
36 |
return f"{generated_caption[0]}"
|