Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -301,7 +301,9 @@ def generateOutput(image_path, audio_path, context_text, question, max_length=3)
|
|
301 |
f"\n<|question|>: {question} \n<|end|>\n<|assistant|>\n"
|
302 |
)
|
303 |
print("input_text:", input_text)
|
304 |
-
|
|
|
|
|
305 |
attention_mask = tokens['attention_mask'].to(device)
|
306 |
# base_phi_model.generate(start_tokens, max_length=2, do_sample=False, pad_token_id=tokenizer.pad_token_id)
|
307 |
|
|
|
301 |
f"\n<|question|>: {question} \n<|end|>\n<|assistant|>\n"
|
302 |
)
|
303 |
print("input_text:", input_text)
|
304 |
+
tokens = tokenizer(input_text, padding=True, truncation=True, max_length=1024, return_tensors="pt")
|
305 |
+
start_tokens = tokens['input_ids'].to(device)
|
306 |
+
# start_tokens = tokenizer(input_text, padding=True, truncation=True, max_length=1024, return_tensors="pt")['input_ids'].to(device)
|
307 |
attention_mask = tokens['attention_mask'].to(device)
|
308 |
# base_phi_model.generate(start_tokens, max_length=2, do_sample=False, pad_token_id=tokenizer.pad_token_id)
|
309 |
|