CareMedEval / src /model_utils.py
doriab's picture
Upload folder using huggingface_hub
6e644fe verified
from vllm import LLM, SamplingParams
from transformers import AutoTokenizer
def load_model():
model_name="Qwen/Qwen3-8B"
print("Loading tokenizer...",flush=True)
tokenizer=AutoTokenizer.from_pretrained(model_name)
print("Initializing the model with vLLM...",flush=True)
sampling_params=SamplingParams(temperature=0.0,top_p=1.0,max_tokens=8000)
llm=LLM(model=model_name,dtype="float16",enforce_eager=True)
print("vLLM model ready",flush=True)
return llm,tokenizer,sampling_params