(model_name)
| 65 | _tokenizer = None |
| 66 | |
| 67 | def _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 | |
| 77 | def move_to(device): |
| 78 | global _llm,_tokenizer |
nothing calls this directly
no outgoing calls
no test coverage detected