MCPcopy
hub / github.com/p-e-w/heretic / get_model_class

Function get_model_class

src/heretic/model.py:39–47  ·  view source on GitHub ↗
(
    model: str,
)

Source from the content-addressed store, hash-verified

37
38
39def get_model_class(
40 model: str,
41) -> Type[AutoModelForImageTextToText] | Type[AutoModelForCausalLM]:
42 configs = PretrainedConfig.get_config_dict(model)
43
44 if any([("vision_config" in config) for config in configs]):
45 return AutoModelForImageTextToText
46 else:
47 return AutoModelForCausalLM
48
49
50@dataclass

Callers 4

obtain_export_strategyFunction · 0.85
__init__Method · 0.85
get_merged_modelMethod · 0.85
reset_modelMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected