Instructions to use epfl-llm/meditron-70b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use epfl-llm/meditron-70b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="epfl-llm/meditron-70b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("epfl-llm/meditron-70b") model = AutoModelForCausalLM.from_pretrained("epfl-llm/meditron-70b", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use epfl-llm/meditron-70b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "epfl-llm/meditron-70b" # 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-70b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/epfl-llm/meditron-70b
- SGLang
How to use epfl-llm/meditron-70b 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-70b" \ --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-70b", "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-70b" \ --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-70b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use epfl-llm/meditron-70b with Docker Model Runner:
docker model run hf.co/epfl-llm/meditron-70b
when attempting to download/save model to run on replicate.com I get KeyError: 'llama'
I am following instructions on
https://replicate.com/docs/guides/push-a-transformers-model#intro
i have setup a huggingface access token and and get quite a bit into the process. But I finally get:
Token will not been saved to git credential helper. Pass add_to_git_credential=True if you want to set the git credential as well.
Token is valid (permission: read).
Your token has been saved to /root/.cache/huggingface/token
Login successful
config.json: 100%|
...
Traceback (most recent call last):
File "/src/script/download_weights", line 16, in
model = AutoModelForCausalLM.from_pretrained('epfl-llm/meditron-70b', cache_dir=CACHE_DIR)
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/models/auto/auto_factory.py", line 434, in from_pretrained
config, kwargs = AutoConfig.from_pretrained(
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 873, in from_pretrained
config_class = CONFIG_MAPPING[config_dict["model_type"]]
File "/root/.pyenv/versions/3.10.13/lib/python3.10/site-packages/transformers/models/auto/configuration_auto.py", line 579, in getitem
raise KeyError(key)
KeyError: 'llama'
ⅹ exit status 1
Any help welcome.