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
Detailed results on MMLU-Medical
Hello,
I am trying to run the MMLU medical tasks on Meditron 7b but obtain low results inconsistent with your reported average of 54.2, I am convinced the issue is with my testing methodology (using lm-eval-harness). Could you please communicate the results on the tasks included in MMLU-Medical for a fair comparison with other models?
Thanks in advance
The 54.2 is from Meditron-7B finetuned on MedMCQA, not the base Meditron-7B model. In the paper we reported the base Meditron-7b's performance with in-context learning (3-shots, 3 run with 3 random seeds): 42.3±2.37. However, we don't have the fine-grained performance of the in-context runs.