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

Function _init_llm

eval/run_predict_qwen2_5VL.py:67–75  ·  view source on GitHub ↗
(model_name)

Source from the content-addressed store, hash-verified

65_tokenizer = None
66
67def _init_llm(model_name):
68 global _llm,_tokenizer
69 if _llm is None:
70 _llm = Qwen2_5_VLForConditionalGeneration.from_pretrained(model_name, trust_remote_code=True,
71 torch_dtype=torch.bfloat16,
72 attn_implementation="flash_attention_2",
73 )
74 if _tokenizer is None:
75 _tokenizer = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
76
77def move_to(device):
78 global _llm,_tokenizer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected