(model_name)
| 56 | _tokenizer = None |
| 57 | |
| 58 | def _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 | |
| 68 | def move_to(device): |
| 69 | global _llm,_tokenizer |
nothing calls this directly
no outgoing calls
no test coverage detected