Text Generation
Transformers
TensorBoard
Safetensors
llama
Generated from Trainer
open-r1
trl
sft
conversational
text-generation-inference
Instructions to use rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean") model = AutoModelForCausalLM.from_pretrained("rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean") 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 rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean
- SGLang
How to use rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean 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 "rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean" \ --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": "rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean", "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 "rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean" \ --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": "rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean with Docker Model Runner:
docker model run hf.co/rkumar1999/Llama-3.1-8B-Instruct-Open-R1-Distill-Lean
End of training
Browse files- README.md +3 -1
- config.json +41 -0
README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
| 1 |
---
|
| 2 |
base_model: meta-llama/Llama-3.1-8B-Instruct
|
|
|
|
| 3 |
library_name: transformers
|
| 4 |
model_name: Llama-3.1-8B-Instruct-Open-R1-Distill-Lean
|
| 5 |
tags:
|
| 6 |
- generated_from_trainer
|
|
|
|
| 7 |
- trl
|
| 8 |
- sft
|
| 9 |
licence: license
|
|
@@ -11,7 +13,7 @@ licence: license
|
|
| 11 |
|
| 12 |
# Model Card for Llama-3.1-8B-Instruct-Open-R1-Distill-Lean
|
| 13 |
|
| 14 |
-
This model is a fine-tuned version of [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct).
|
| 15 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 16 |
|
| 17 |
## Quick start
|
|
|
|
| 1 |
---
|
| 2 |
base_model: meta-llama/Llama-3.1-8B-Instruct
|
| 3 |
+
datasets: Tonic/MiniF2F
|
| 4 |
library_name: transformers
|
| 5 |
model_name: Llama-3.1-8B-Instruct-Open-R1-Distill-Lean
|
| 6 |
tags:
|
| 7 |
- generated_from_trainer
|
| 8 |
+
- open-r1
|
| 9 |
- trl
|
| 10 |
- sft
|
| 11 |
licence: license
|
|
|
|
| 13 |
|
| 14 |
# Model Card for Llama-3.1-8B-Instruct-Open-R1-Distill-Lean
|
| 15 |
|
| 16 |
+
This model is a fine-tuned version of [meta-llama/Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct) on the [Tonic/MiniF2F](https://huggingface.co/datasets/Tonic/MiniF2F) dataset.
|
| 17 |
It has been trained using [TRL](https://github.com/huggingface/trl).
|
| 18 |
|
| 19 |
## Quick start
|
config.json
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_attn_implementation_autoset": true,
|
| 3 |
+
"_name_or_path": "meta-llama/Llama-3.1-8B-Instruct",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"LlamaForCausalLM"
|
| 6 |
+
],
|
| 7 |
+
"attention_bias": false,
|
| 8 |
+
"attention_dropout": 0.0,
|
| 9 |
+
"bos_token_id": 128000,
|
| 10 |
+
"eos_token_id": [
|
| 11 |
+
128001,
|
| 12 |
+
128008,
|
| 13 |
+
128009
|
| 14 |
+
],
|
| 15 |
+
"head_dim": 128,
|
| 16 |
+
"hidden_act": "silu",
|
| 17 |
+
"hidden_size": 4096,
|
| 18 |
+
"initializer_range": 0.02,
|
| 19 |
+
"intermediate_size": 14336,
|
| 20 |
+
"max_position_embeddings": 131072,
|
| 21 |
+
"mlp_bias": false,
|
| 22 |
+
"model_type": "llama",
|
| 23 |
+
"num_attention_heads": 32,
|
| 24 |
+
"num_hidden_layers": 32,
|
| 25 |
+
"num_key_value_heads": 8,
|
| 26 |
+
"pretraining_tp": 1,
|
| 27 |
+
"rms_norm_eps": 1e-05,
|
| 28 |
+
"rope_scaling": {
|
| 29 |
+
"factor": 8.0,
|
| 30 |
+
"high_freq_factor": 4.0,
|
| 31 |
+
"low_freq_factor": 1.0,
|
| 32 |
+
"original_max_position_embeddings": 8192,
|
| 33 |
+
"rope_type": "llama3"
|
| 34 |
+
},
|
| 35 |
+
"rope_theta": 500000.0,
|
| 36 |
+
"tie_word_embeddings": false,
|
| 37 |
+
"torch_dtype": "float32",
|
| 38 |
+
"transformers_version": "4.49.0",
|
| 39 |
+
"use_cache": true,
|
| 40 |
+
"vocab_size": 128256
|
| 41 |
+
}
|