Download src/model_utils.py from doriab/CareMedEval: direct link, hf CLI and curl.
- Browser
- Download file 526 Bytes
-
https://huggingface.co/datasets/doriab/CareMedEval/resolve/main/src/model_utils.py
- Command line
-
hf download hf://datasets/doriab/CareMedEval/src/model_utils.py
-
curl -L -o model_utils.py https://huggingface.co/datasets/doriab/CareMedEval/resolve/main/src/model_utils.py
526 Bytes
| 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 |