Text Generation
Transformers
Safetensors
PyTorch
English
llama
facebook
meta
llama-3
conversational
text-generation-inference
Instructions to use meta-llama/Meta-Llama-3-70B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use meta-llama/Meta-Llama-3-70B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="meta-llama/Meta-Llama-3-70B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3-70B-Instruct") model = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3-70B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- HuggingChat
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use meta-llama/Meta-Llama-3-70B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "meta-llama/Meta-Llama-3-70B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Meta-Llama-3-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/meta-llama/Meta-Llama-3-70B-Instruct
- SGLang
How to use meta-llama/Meta-Llama-3-70B-Instruct 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 "meta-llama/Meta-Llama-3-70B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Meta-Llama-3-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "meta-llama/Meta-Llama-3-70B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "meta-llama/Meta-Llama-3-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use meta-llama/Meta-Llama-3-70B-Instruct with Docker Model Runner:
docker model run hf.co/meta-llama/Meta-Llama-3-70B-Instruct
[READ IF YOU DO NOT HAVE ACCESS] Getting access to the model
pinned 6
#53 opened almost 2 years ago
by
osanseviero
Request for manual review of my access application
#76 opened about 1 month ago
by
wm567
fix: set `clean_up_tokenization_spaces` to `false`
#75 opened 2 months ago
by
maxsloef
Install & run this model easily using llmpm
#74 opened 2 months ago
by
sarthak-saxena
OSError: Consistency check failed
#72 opened about 1 year ago
by
BigbigShark
Unauthourized error
#70 opened over 1 year ago
by
happidence1
ValueError: Cannot use apply_chat_template()
#69 opened over 1 year ago
by
inkyxfl
For some of my responses I get error: ProtocolError('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))
#68 opened over 1 year ago
by
sabszh
cannot use model via the serverless API
2
#66 opened over 1 year ago
by
lenadan
Changes in the generation_config.json?
#65 opened over 1 year ago
by
rootacess
Permission issue accessing 70B-Instruct
🔥 1
#62 opened almost 2 years ago
by
Erikddahl
uncensored model
1
#61 opened almost 2 years ago
by
Keionsa
RuntimeError: repeats can not be negative
#60 opened almost 2 years ago
by
SirCockroach
Issue with Deprecated Arguments in AutoTrain Advanced for LLaMA 3 (70B) - DPO
👀 2
2
#59 opened almost 2 years ago
by
GuusBouwensNL
Help Needed: Installing & Running Llama 3: 70B (140GB) on Dual RTX 4090 & 64GB RAM
👍 3
1
#58 opened almost 2 years ago
by
kirushake
requires Pro
😔🔥 2
5
#57 opened almost 2 years ago
by
MatrixIA
Superalignment
#56 opened almost 2 years ago
by
shoopenenok
Add co2_eq_emissions to README so that the HF API exposes this info to users.
#55 opened almost 2 years ago
by
selenecodes
eos token different from base model
#52 opened almost 2 years ago
by
metric-space
not a string
🔥 1
1
#51 opened about 2 years ago
by
zhouxiaoou
clean_up_tokenization_spaces=True causes formatting issues, why is it set?
🔥 1
2
#44 opened about 2 years ago
by
dzhulgakov
P3 EC2 :: torch.nn DataParallel Error
3
#42 opened about 2 years ago
by
AFoudree
Chat Usage Error - "Input validation error"
1
#41 opened about 2 years ago
by
alksndrmnts
Message: 'You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset'
#39 opened about 2 years ago
by
hmanju
Pytorch Bin files for gpt-fast
#38 opened about 2 years ago
by
srinivasbilla
Anyone else encountering bad quantized(?) performance with Llama3-70B?
1
#37 opened about 2 years ago
by
philjd
reaaply for access to llama3
👍 1
3
#35 opened about 2 years ago
by
merryjane
[Don't merge] inferentia2 workaround
#34 opened about 2 years ago
by
philschmid
Does the API work with Llama3 format to provide system + user-assistant conversation?
👍 1
1
#29 opened about 2 years ago
by
maxikq
API parameter `"return_full_text": false` doesn't work
#28 opened about 2 years ago
by
maxikq
Error while running for inference
#27 opened about 2 years ago
by
sumitsoman
model file
1
#25 opened about 2 years ago
by
dawangbaixiaofu
Anyone have used Llama 3 70B-I in huggingface Inference API ?
4
#24 opened about 2 years ago
by
TikaToka
85.44 GSM8K Top on HF - New Record!
1
#22 opened about 2 years ago
by
LordTwave
Updated chat_template
2
#18 opened about 2 years ago
by
AswanthCManoj
What is the "system" prompt?
3
#13 opened about 2 years ago
by
kk3dmax
Model makes weird grammar mistakes with punctuation
1
#11 opened about 2 years ago
by
nonetrix
AWQ Quantization?
👀 5
1
#10 opened about 2 years ago
by
cbML
Update numbering format of Prohibited Uses
#9 opened about 2 years ago
by
BallisticAI
Cutoff March, 2023? Shouldn't it be 2024?
2
#7 opened about 2 years ago
by
kil3r