Text Generation
Transformers
Safetensors
PyTorch
llama
facebook
meta
llama-3
conversational
text-generation-inference
Instructions to use Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct") model = AutoModelForCausalLM.from_pretrained("Efficient-Large-Model/Meta-Llama-3.1-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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Efficient-Large-Model/Meta-Llama-3.1-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": "Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct
- SGLang
How to use Efficient-Large-Model/Meta-Llama-3.1-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 "Efficient-Large-Model/Meta-Llama-3.1-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": "Efficient-Large-Model/Meta-Llama-3.1-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 "Efficient-Large-Model/Meta-Llama-3.1-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": "Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct with Docker Model Runner:
docker model run hf.co/Efficient-Large-Model/Meta-Llama-3.1-70B-Instruct
Upload files with huggingface_hub
Browse filesUpload model-00007-of-00030.safetensors
Upload model-00013-of-00030.safetensors
Upload model-00020-of-00030.safetensors
Upload model-00028-of-00030.safetensors
Upload model-00018-of-00030.safetensors
Upload model-00015-of-00030.safetensors
Upload model-00006-of-00030.safetensors
Upload model-00008-of-00030.safetensors
- model-00006-of-00030.safetensors +3 -0
- model-00007-of-00030.safetensors +3 -0
- model-00008-of-00030.safetensors +3 -0
- model-00013-of-00030.safetensors +3 -0
- model-00015-of-00030.safetensors +3 -0
- model-00018-of-00030.safetensors +3 -0
- model-00020-of-00030.safetensors +3 -0
- model-00028-of-00030.safetensors +3 -0
model-00006-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:348cd98f65a4b29af25330445841428a9a16e41569c067e63b7f44af9ea19329
|
| 3 |
+
size 4664167408
|
model-00007-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e2e52303706b73fca20c1f4137dcdd16929487b432b805d32e6a0a4967d518d2
|
| 3 |
+
size 4664167408
|
model-00008-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:6240b8784a4236a01656e9af27d09b122417ee83eb2d1a35e46f31456230059f
|
| 3 |
+
size 4999711728
|
model-00013-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:18d9997b7062b00f7b81b9b58f9b684cdbc4368c7d57d14b593be66f6af4a8ce
|
| 3 |
+
size 4999711728
|
model-00015-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef1808b365e913e1370dce52bf05af99e8bbc5f98a74388534be35b18929a96d
|
| 3 |
+
size 4664134408
|
model-00018-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:538c62f520e233931bc01ae177279d6b97b30642e959e0fd5c78bfdef25833a9
|
| 3 |
+
size 4999711728
|
model-00020-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd8f2458bad38f36b78fe3838f99557f7f6fdc33c33ba993e358c306dd142fa3
|
| 3 |
+
size 4664134408
|
model-00028-of-00030.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:031f4e3f72548c41f382ae155605729f7a05359b24721ee99da6893939f78cbe
|
| 3 |
+
size 4999711728
|