init.
(self,
model_path: str,
with_llm: bool = False,
max_memory: dict[int, int] = None,
hf_config: AutoConfig = None,
backend: str = '',
trust_remote_code: bool = False)
| 53 | ] |
| 54 | |
| 55 | def __init__(self, |
| 56 | model_path: str, |
| 57 | with_llm: bool = False, |
| 58 | max_memory: dict[int, int] = None, |
| 59 | hf_config: AutoConfig = None, |
| 60 | backend: str = '', |
| 61 | trust_remote_code: bool = False): |
| 62 | """init.""" |
| 63 | self.model_path = model_path |
| 64 | self.with_llm = with_llm |
| 65 | self.max_memory = max_memory |
| 66 | self.backend = backend |
| 67 | self.mm_feature_dtype: torch.dtype | None = None |
| 68 | if hf_config is None: |
| 69 | _, hf_config = get_model_arch(model_path, trust_remote_code=trust_remote_code) |
| 70 | self.hf_config = hf_config |
| 71 | self.image_token_id = self.get_pad_token_id(model_path, hf_config, trust_remote_code=trust_remote_code) or 0 |
| 72 | |
| 73 | def set_mm_feature_dtype(self, dtype: torch.dtype | None): |
| 74 | """Set target dtype for floating MM feature tensors.""" |
nothing calls this directly
no test coverage detected