llama3_2_vision_transform¶
- torchtune.models.llama3_2_vision.llama3_2_vision_transform(path: str, max_seq_len: int = 8192, image_size: int = 560, special_tokens_path: Optional[str] = None, prompt_template: Optional[Union[str, Dict[Literal['system', 'user', 'assistant', 'ipython'], Tuple[str, str]]]] = None) Llama3VisionTransform[source]¶
Llama3 Vision 的数据转换(包括分词器)。
- Parameters:
path (str) – 分词器的路径
max_seq_len (int) – 用于对单个消息列表进行标记化的最大序列长度,超过此长度的输入将被截断。
image_size (int) – 基础图像大小,图像将被平铺并调整为此大小。 默认值为560用于Instruct权重,使用448用于预训练。
special_tokens_path (Optional[str]) – 指向Hugging Face模型文件中包含所有注册特殊标记的
tokenizer.json的路径,或者结构类似的本地json文件。默认为None,以使用规范的Llama3特殊标记。prompt_template (可选[_TemplateType]) – 可选的指定提示模板。 如果是字符串,则假定为
PromptTemplateInterface类的点路径。 如果是字典,则假定为自定义提示模板,将角色映射到前置/后置标签。
- Returns:
Llama 3.2 视觉变换的实例化
- Return type: