Skip to content

Commit fe7ac56

Browse files
Update multi_modal_infer.py (meta-llama#696)
2 parents 8fc300b + 0fc9fca commit fe7ac56

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

recipes/quickstart/inference/local_inference/multi_modal_infer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def generate_text_from_image(model, processor, image, prompt_text: str, temperat
3838
{"role": "user", "content": [{"type": "image"}, {"type": "text", "text": prompt_text}]}
3939
]
4040
prompt = processor.apply_chat_template(conversation, add_generation_prompt=True, tokenize=False)
41-
inputs = processor(prompt, image, return_tensors="pt").to(model.device)
41+
inputs = processor(image, prompt, return_tensors="pt").to(model.device)
4242
output = model.generate(**inputs, temperature=temperature, top_p=top_p, max_new_tokens=512)
4343
return processor.decode(output[0])[len(prompt):]
4444

0 commit comments

Comments
 (0)