Text Generation
Transformers
Safetensors
English
llama
meta
llama-3
conversational
text-generation-inference
Instructions to use DevsDoCode/Llama-3-8B-Instruct-1048k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use DevsDoCode/Llama-3-8B-Instruct-1048k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="DevsDoCode/Llama-3-8B-Instruct-1048k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("DevsDoCode/Llama-3-8B-Instruct-1048k") model = AutoModelForCausalLM.from_pretrained("DevsDoCode/Llama-3-8B-Instruct-1048k") 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 Settings
- vLLM
How to use DevsDoCode/Llama-3-8B-Instruct-1048k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "DevsDoCode/Llama-3-8B-Instruct-1048k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "DevsDoCode/Llama-3-8B-Instruct-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/DevsDoCode/Llama-3-8B-Instruct-1048k
- SGLang
How to use DevsDoCode/Llama-3-8B-Instruct-1048k 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 "DevsDoCode/Llama-3-8B-Instruct-1048k" \ --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": "DevsDoCode/Llama-3-8B-Instruct-1048k", "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 "DevsDoCode/Llama-3-8B-Instruct-1048k" \ --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": "DevsDoCode/Llama-3-8B-Instruct-1048k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use DevsDoCode/Llama-3-8B-Instruct-1048k with Docker Model Runner:
docker model run hf.co/DevsDoCode/Llama-3-8B-Instruct-1048k
Commit ·
ac76161
1
Parent(s): 245f0f2
Uploaded Model Files
Browse files
model-00001-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0882957140d91b8611e3c26ad3661a1d42219d42ab2a0921ba9f4caee404f732
|
| 3 |
+
size 4976698672
|
model-00002-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:618484fb670e5097801763c94ab23eec8cda184fd0b4d8b2e188c95a64cd12a2
|
| 3 |
+
size 4999802720
|
model-00003-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8069bd41122bb59699730f13641ac9eabb6c83826099ee584cb6c17855dbf3b6
|
| 3 |
+
size 4915916176
|
model-00004-of-00004.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b06463b99d2c79a77409db29b0f023a5fe2ea8b898d4eae1d6e36313ab5ef93b
|
| 3 |
+
size 1168138808
|