[Model] Molmo vLLM Integration (#9016)

Co-authored-by: sanghol <sanghol@allenai.org>
Co-authored-by: Roger Wang <136131678+ywang96@users.noreply.github.com>
Co-authored-by: Roger Wang <ywang@roblox.com>
This commit is contained in:
Reza Salehi
2024-10-14 07:56:24 -07:00
committed by GitHub
parent 16b24e7dcd
commit dfe43a2071
7 changed files with 1319 additions and 3 deletions

View File

@@ -300,6 +300,23 @@ def run_mllama(question: str, modality: str):
return llm, prompt, stop_token_ids
# Molmo
def run_molmo(question, modality):
assert modality == "image"
model_name = "allenai/Molmo-7B-D-0924"
llm = LLM(
model=model_name,
trust_remote_code=True,
dtype="bfloat16",
)
prompt = question
stop_token_ids = None
return llm, prompt, stop_token_ids
# GLM-4v
def run_glm4v(question: str, modality: str):
assert modality == "image"
@@ -331,6 +348,7 @@ model_example_map = {
"qwen_vl": run_qwen_vl,
"qwen2_vl": run_qwen2_vl,
"mllama": run_mllama,
"molmo": run_molmo,
"glm4v": run_glm4v,
}