Text Generation
Transformers
PyTorch
llama
llama-factory
full
Generated from Trainer
conversational
text-generation-inference
Instructions to use graf/Llama-3.2-1B-RM-GSM8k with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use graf/Llama-3.2-1B-RM-GSM8k with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="graf/Llama-3.2-1B-RM-GSM8k") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("graf/Llama-3.2-1B-RM-GSM8k") model = AutoModelForCausalLM.from_pretrained("graf/Llama-3.2-1B-RM-GSM8k", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use graf/Llama-3.2-1B-RM-GSM8k with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "graf/Llama-3.2-1B-RM-GSM8k" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "graf/Llama-3.2-1B-RM-GSM8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/graf/Llama-3.2-1B-RM-GSM8k
- SGLang
How to use graf/Llama-3.2-1B-RM-GSM8k 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 "graf/Llama-3.2-1B-RM-GSM8k" \ --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": "graf/Llama-3.2-1B-RM-GSM8k", "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 "graf/Llama-3.2-1B-RM-GSM8k" \ --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": "graf/Llama-3.2-1B-RM-GSM8k", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use graf/Llama-3.2-1B-RM-GSM8k with Docker Model Runner:
docker model run hf.co/graf/Llama-3.2-1B-RM-GSM8k
reward
This model is a fine-tuned version of meta-llama/Llama-3.2-1B-Instruct on the gsm8k_llama3.2-1B_128_1ep dataset. It achieves the following results on the evaluation set:
- Loss: 0.6323
- Accuracy: 0.5876
Model description
More information needed
Intended uses & limitations
More information needed
Training and evaluation data
More information needed
Training procedure
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 5e-06
- train_batch_size: 2
- eval_batch_size: 4
- seed: 42
- distributed_type: multi-GPU
- num_devices: 8
- gradient_accumulation_steps: 8
- total_train_batch_size: 128
- total_eval_batch_size: 32
- optimizer: Use adamw_torch with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- lr_scheduler_warmup_ratio: 0.03
- num_epochs: 1.0
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy |
|---|---|---|---|---|
| 0.7961 | 0.0855 | 5 | 0.5987 | 0.6209 |
| 0.5229 | 0.1709 | 10 | 0.6532 | 0.5292 |
| 0.4513 | 0.2564 | 15 | 0.6738 | 0.4716 |
| 0.5194 | 0.3419 | 20 | 0.6736 | 0.4769 |
| 0.4323 | 0.4274 | 25 | 0.6592 | 0.5277 |
| 0.4733 | 0.5128 | 30 | 0.6529 | 0.5504 |
| 0.3579 | 0.5983 | 35 | 0.6559 | 0.5299 |
| 0.2933 | 0.6838 | 40 | 0.6503 | 0.5322 |
| 0.3119 | 0.7692 | 45 | 0.6438 | 0.5504 |
| 0.3451 | 0.8547 | 50 | 0.6330 | 0.5883 |
| 0.3238 | 0.9402 | 55 | 0.6331 | 0.5845 |
Framework versions
- Transformers 4.46.1
- Pytorch 2.5.1
- Datasets 3.1.0
- Tokenizers 0.20.1
- Downloads last month
- 3
Model tree for graf/Llama-3.2-1B-RM-GSM8k
Base model
meta-llama/Llama-3.2-1B-Instruct