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

Function _init_llm

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

Source from the content-addressed store, hash-verified

51_tokenizer = None
52
53def _init_llm(model_name):
54 global _llm,_tokenizer
55 if _llm is None:
56 _llm = Qwen2VLForConditionalGeneration.from_pretrained(
57 model_name, trust_remote_code=True, torch_dtype=torch.bfloat16,
58 attn_implementation="flash_attention_2",
59 )
60 if _tokenizer is None:
61 _tokenizer = AutoProcessor.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