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

Function _init_llm

eval/run_predict_aguvis.py:408–428  ·  view source on GitHub ↗

load the models and its relative processor, tokenizer. Args: model_name (str): the model name or model path. Returns: None

(model_name:str)

Source from the content-addressed store, hash-verified

406
407
408def _init_llm(model_name:str) -> None:
409 """
410 load the models and its relative processor, tokenizer.
411
412 Args:
413 model_name (str): the model name or model path.
414
415 Returns:
416 None
417 """
418
419 global _llm, _processor, _tokenizer
420
421 if _llm is None:
422 _llm = Qwen2VLForConditionalGeneration.from_pretrained(model_name, trust_remote_code=True)
423
424 if _processor is None:
425 _processor = Qwen2VLProcessor.from_pretrained(model_name, trust_remote_code=True)
426
427 if _tokenizer is None:
428 _tokenizer = _processor.tokenizer
429
430
431def move_to(device):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected