Instructions to use savanladani/week2-llama3.2-1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use savanladani/week2-llama3.2-1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="savanladani/week2-llama3.2-1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("savanladani/week2-llama3.2-1B") model = AutoModelForCausalLM.from_pretrained("savanladani/week2-llama3.2-1B", 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]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use savanladani/week2-llama3.2-1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "savanladani/week2-llama3.2-1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "savanladani/week2-llama3.2-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/savanladani/week2-llama3.2-1B
- SGLang
How to use savanladani/week2-llama3.2-1B 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 "savanladani/week2-llama3.2-1B" \ --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": "savanladani/week2-llama3.2-1B", "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 "savanladani/week2-llama3.2-1B" \ --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": "savanladani/week2-llama3.2-1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use savanladani/week2-llama3.2-1B with Docker Model Runner:
docker model run hf.co/savanladani/week2-llama3.2-1B
Model Overview
This model is a fine-tuned variant of Llama-3.2-1B, leveraging ORPO (Optimized Regularization for Prompt Optimization) for enhanced performance. It has been fine-tuned using the mlabonne/orpo-dpo-mix-40k dataset as part of the Finetuning Open Source LLMs Course - Week 2 Project.
Intended Use
This model is optimized for general-purpose language tasks, including text parsing, understanding contextual prompts, and enhanced interpretability in natural language processing applications.
Evaluation Results
The model was evaluated on the following benchmarks, with the following performance metrics:
| Tasks | Version | Filter | n-shot | Metric | Value | Stderr | ||
|---|---|---|---|---|---|---|---|---|
| eq_bench | 2.1 | none | 0 | eqbench | ↑ | 1.5355 | ± | 0.9174 |
| none | 0 | percent_parseable | ↑ | 16.9591 | ± | 2.8782 | ||
| hellaswag | 1 | none | 0 | acc | ↑ | 0.4812 | ± | 0.0050 |
| none | 0 | acc_norm | ↑ | 0.6467 | ± | 0.0048 | ||
| ifeval | 4 | none | 0 | inst_level_loose_acc | ↑ | 0.3993 | ± | N/A |
| none | 0 | inst_level_strict_acc | ↑ | 0.2974 | ± | N/A | ||
| none | 0 | prompt_level_loose_acc | ↑ | 0.2754 | ± | 0.0192 | ||
| none | 0 | prompt_level_strict_acc | ↑ | 0.1848 | ± | 0.0167 | ||
| tinyMMLU | 0 | none | 0 | acc_norm | ↑ | 0.3996 | ± | N/A |
Key Features
- Model Size: 1 Billion parameters
- Fine-tuning Method: ORPO
- Dataset: mlabonne/orpo-dpo-mix-40k
- Downloads last month
- 3
Model tree for savanladani/week2-llama3.2-1B
Base model
meta-llama/Llama-3.2-1BDataset used to train savanladani/week2-llama3.2-1B
Evaluation results
- EQ-Bench (0-Shot) on mlabonne/orpo-dpo-mix-40kself-reported1.536