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

Method load_model

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

Source from the content-addressed store, hash-verified

271 return "tool-llama-single-round" == model_path
272
273 def load_model(self, model_path: str, from_pretrained_kwargs: dict):
274 tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, model_max_length=8192)
275 model = AutoModelForCausalLM.from_pretrained(
276 model_path,
277 low_cpu_mem_usage=True,
278 **from_pretrained_kwargs,
279 )
280 return model, tokenizer
281
282 def get_default_conv_template(self, model_path: str) -> Conversation:
283 return get_conv_template("tool-llama-single-round")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected