MCPcopy Create free account
hub / github.com/OpenBMB/ToolBench / load_model

Method load_model

toolbench/model/model_adapter.py:224–232  ·  view source on GitHub ↗
(self, model_path: str, from_pretrained_kwargs: dict)

Source from the content-addressed store, hash-verified

222 return "vicuna" in model_path
223
224 def load_model(self, model_path: str, from_pretrained_kwargs: dict):
225 tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
226 model = AutoModelForCausalLM.from_pretrained(
227 model_path,
228 low_cpu_mem_usage=True,
229 **from_pretrained_kwargs,
230 )
231 self.raise_warning_for_old_weights(model)
232 return model, tokenizer
233
234 def get_default_conv_template(self, model_path: str) -> Conversation:
235 return get_conv_template("vicuna-v1.1")

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected