Spaces:
Runtime error
Runtime error
Gabriel C
commited on
Commit
β’
ab95b6f
1
Parent(s):
b598eba
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,9 @@ def generate_caption(image):
|
|
27 |
# autoregressively complete prompt
|
28 |
output = model.generate(**inputs, max_new_tokens=200)
|
29 |
|
30 |
-
|
|
|
|
|
31 |
|
32 |
|
33 |
# Define the Gradio interface
|
|
|
27 |
# autoregressively complete prompt
|
28 |
output = model.generate(**inputs, max_new_tokens=200)
|
29 |
|
30 |
+
prompt_len = inputs["input_ids"].shape[1]
|
31 |
+
decoded_text = processor.batch_decode(output[:, prompt_len:])[0]
|
32 |
+
return decoded_text
|
33 |
|
34 |
|
35 |
# Define the Gradio interface
|