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

Function _init_llm

eval/run_predict_ui_tars.py:58–66  ·  view source on GitHub ↗
(model_name)

Source from the content-addressed store, hash-verified

56_tokenizer = None
57
58def _init_llm(model_name):
59 global _llm,_tokenizer
60 if _llm is None:
61 _llm = Qwen2VLForConditionalGeneration.from_pretrained(
62 model_name, trust_remote_code=True, torch_dtype=torch.bfloat16,
63 attn_implementation="flash_attention_2",
64 )
65 if _tokenizer is None:
66 _tokenizer = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
67
68def move_to(device):
69 global _llm,_tokenizer

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected