Unverified Commit a6073124 authored by Chen Zhang's avatar Chen Zhang Committed by GitHub
Browse files

[Doc] Update mllama example based on official doc (#11567)


Signed-off-by: default avatarChen Zhang <zhangch99@outlook.com>
parent ac797994
......@@ -308,7 +308,20 @@ def run_mllama(question: str, modality: str):
disable_mm_preprocessor_cache=args.disable_mm_preprocessor_cache,
)
prompt = f"<|image|><|begin_of_text|>{question}"
tokenizer = AutoTokenizer.from_pretrained(model_name)
messages = [{
"role":
"user",
"content": [{
"type": "image"
}, {
"type": "text",
"text": f"{question}"
}]
}]
prompt = tokenizer.apply_chat_template(messages,
add_generation_prompt=True,
tokenize=False)
stop_token_ids = None
return llm, prompt, stop_token_ids
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment