Instructions to use epfl-llm/meditron-7b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use epfl-llm/meditron-7b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="epfl-llm/meditron-7b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("epfl-llm/meditron-7b") model = AutoModelForCausalLM.from_pretrained("epfl-llm/meditron-7b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use epfl-llm/meditron-7b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "epfl-llm/meditron-7b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-llm/meditron-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/epfl-llm/meditron-7b
- SGLang
How to use epfl-llm/meditron-7b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "epfl-llm/meditron-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-llm/meditron-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "epfl-llm/meditron-7b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epfl-llm/meditron-7b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use epfl-llm/meditron-7b with Docker Model Runner:
docker model run hf.co/epfl-llm/meditron-7b
Is Meditron-7b better than LLaMA2-7b?
#9
by sean0042 - opened
Hello,
In general, it's very difficult for us to analyze the results given the limited information of the evaluation settings:
- Did you finetune the models or are you using zero-shot prompting with the base models?
- What kind of inference mode are you using?
- How are you parsing the answers?
- Are you using in-context learning?
- If 4 is true, are you running multiple runs with different in-context examples sampled with different random seeds? For example, PubMedQA has very large variance (15 - 50) under different in-context examples.
We refer to our reported in-context learning results from the paper:
As you can see, on MedQA-5 and MedMCQA, Meditron-7B underperforms Llama-2-7b. The performances of these two models on MMLU-Medical and MedQA-4 are close. It is after fine-tuning on the datasets we observe a large performance gain.

