Spaces:
Runtime error
Runtime error
update app.py
Browse files
app.py
CHANGED
@@ -119,7 +119,7 @@ def generate(
|
|
119 |
image = image.resize((224, 224))
|
120 |
batch_images = image_processor(image).unsqueeze(0).unsqueeze(1).unsqueeze(0)
|
121 |
if idx == 1:
|
122 |
-
prompt = [f"{tokenizer.bos_token}<|#image#|>{tokenizer.pad_token * vis_embed_size}<|#endofimage#|><|#object#|>{text.rstrip('.').strip()}<|#endofobject#|><|#visual#|>"]
|
123 |
bad_words_ids = None
|
124 |
max_generation_length = 5
|
125 |
else:
|
|
|
119 |
image = image.resize((224, 224))
|
120 |
batch_images = image_processor(image).unsqueeze(0).unsqueeze(1).unsqueeze(0)
|
121 |
if idx == 1:
|
122 |
+
prompt = [f"{tokenizer.bos_token}<|#image#|>{tokenizer.pad_token * vis_embed_size}<|#endofimage#|><|#object#|> {text.rstrip('.').strip()}<|#endofobject#|><|#visual#|>"]
|
123 |
bad_words_ids = None
|
124 |
max_generation_length = 5
|
125 |
else:
|