[VLM][Model] Support image input for Chameleon (#6633)

This commit is contained in:
Roger Wang
2024-07-22 23:50:48 -07:00
committed by GitHub
parent c5201240a4
commit 22fa2e35cb
7 changed files with 696 additions and 58 deletions

View File

@@ -105,7 +105,8 @@ def _image_token_str(model_config: ModelConfig,
return None
if model_type.startswith("llava"):
return tokenizer.decode(model_config.hf_config.image_token_index)
if model_type == "chameleon":
return "<image>"
raise TypeError("Unknown model type: {model_type}")