Text Generation
Transformers
Safetensors
PyTorch
Turkish
llama
legal
turkish
llama-3.1
fp8
bfloat16
mixed-precision
question-answering
fsdp-v2
distributed-training
conversational
text-generation-inference
Instructions to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp") model = AutoModelForCausalLM.from_pretrained("newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", device_map="auto") 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 newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp
- SGLang
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp 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 "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp" \ --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": "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", "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 "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp" \ --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": "newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp with Docker Model Runner:
docker model run hf.co/newmindai/Llama-3.1-8B-Instruct_w16a8_rw_with_gw_hp
Update README.md
Browse files
README.md
CHANGED
|
@@ -118,12 +118,13 @@ if use_fp8:
|
|
| 118 |
|---------|---------|---------|---------|---------|
|
| 119 |
||  | || |
|
| 120 |
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
|
| 124 |
-
|
|
| 125 |
-
| **
|
| 126 |
-
| **
|
|
|
|
| 127 |
|
| 128 |
|
| 129 |
## Implementation
|
|
|
|
| 118 |
|---------|---------|---------|---------|---------|
|
| 119 |
||  | || |
|
| 120 |
|
| 121 |
+
| Model | Training Time (mins) | Memory Allocated (avg %) | GPU Utilization (avg %) | Speed vs bf16 |
|
| 122 |
+
| :-------------------------------------------------- | --------------------: | -----------------------: | -----------------------: | -------------: |
|
| 123 |
+
| **Llama-3.1-8B-Instruct_w16a16** | 138.75267 | 74.4189 | 56.6059% | _ |
|
| 124 |
+
| **Llama-3.1-8B-Instruct-w16a8-tw** | 123.75267 | 68.8982 | 97.5364% | 12.11% |
|
| 125 |
+
| **Llama-3.1-8B-Instruct_w16a8_rw** | 115.75364 | 69.6132 | 97.7689% | 19.87% |
|
| 126 |
+
| **Llama-3.1-8B-Instruct_w16a8_rowwise_with_gw_hp** | 109.00364 | 69.4806 | 97.3312% | 27.33% |
|
| 127 |
+
| **Llama-3.1-8B-Instruct-w16a8-mxtw** | 64.00328 | 68.8982 | 95.5661% | 116.82% |
|
| 128 |
|
| 129 |
|
| 130 |
## Implementation
|