[Model] Initialize Phi-3-vision support (#4986)
This commit is contained in:
@@ -144,6 +144,7 @@ class HfRunner:
|
||||
model_name: str,
|
||||
dtype: str = "half",
|
||||
*,
|
||||
model_kwargs: Optional[Dict[str, Any]] = None,
|
||||
is_embedding_model: bool = False,
|
||||
is_vision_model: bool = False,
|
||||
) -> None:
|
||||
@@ -166,11 +167,13 @@ class HfRunner:
|
||||
else:
|
||||
auto_cls = AutoModelForCausalLM
|
||||
|
||||
model_kwargs = model_kwargs if model_kwargs is not None else {}
|
||||
self.model = self.wrap_device(
|
||||
auto_cls.from_pretrained(
|
||||
model_name,
|
||||
torch_dtype=torch_dtype,
|
||||
trust_remote_code=True,
|
||||
**model_kwargs,
|
||||
))
|
||||
|
||||
self.tokenizer = AutoTokenizer.from_pretrained(
|
||||
|
||||
Reference in New Issue
Block a user