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

Method load_model

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

Source from the content-addressed store, hash-verified

32 return True
33
34 def load_model(self, model_path: str, from_pretrained_kwargs: dict):
35 tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False)
36 model = AutoModelForCausalLM.from_pretrained(
37 model_path, low_cpu_mem_usage=True, **from_pretrained_kwargs
38 )
39 return model, tokenizer
40
41 def get_default_conv_template(self, model_path: str) -> Conversation:
42 return get_conv_template("one_shot")

Callers 1

load_modelFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected