MCPcopy Create free account
hub / github.com/OpenBMB/AgentCPM-GUI / _init_llm

Function _init_llm

eval/run_predict_minicpm.py:56–61  ·  view source on GitHub ↗
(model_name)

Source from the content-addressed store, hash-verified

54_tokenizer = None
55
56def _init_llm(model_name):
57 global _llm,_tokenizer
58 if _llm is None:
59 _llm = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True,torch_dtype=torch.bfloat16)
60 if _tokenizer is None:
61 _tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
62
63def move_to(device):
64 global _llm,_tokenizer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected