Instructions to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Transformers:
# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M # Run inference directly in the terminal: llama cli -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M # Run inference directly in the terminal: llama cli -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Use Docker
docker model run hf.co/eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Ollama:
ollama run hf.co/eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
- Unsloth Studio
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 to start chatting
- Pi
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
- Docker Model Runner
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Docker Model Runner:
docker model run hf.co/eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
- Lemonade
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Run and chat with the model
lemonade run user.qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1 with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q4_K_M
Run Hermes
hermes
- Atomic Chat
Qwen2.5-1.5B-Instruct Fine-Tuned on CodeAlpaca-20K with DeepSeek Augmentation
Model Overview
This model is a fine-tuned version of Qwen2.5-1.5B-Instruct, designed for instruction-following and structured reasoning. It is trained on an enhanced CodeAlpaca-20K dataset, incorporating Chain-of-Thought (CoT) reasoning augmented by DeepSeek AI.
Key Features
- Base Model: Qwen2.5-1.5B-Instruct
- Fine-Tuned On: CodeAlpaca-20K enhanced with DeepSeek-V3
- Optimized for: Instruction-following, structured reasoning, and problem-solving
- Fine-tuning method: LoRA (Low-Rank Adaptation)
- Inference-ready: Available on Hugging Face and compatible with
llama.cpp - Supports GGUF: Optimized versions for Q4_K_M, Q8_0, Q5_K_M, and FP16
Model Details
- Developed by: Yiqiao Yin
- Model Type: Causal Language Model (Text Generation)
- Languages: English (
en) - License: MIT License
- Fine-tuned from:
Qwen/Qwen2.5-1.5B-Instruct - Training Library:
transformers+unsloth+trl - Quantization: GGUF (
Q4_K_M, Q8_0, Q5_K_M, f16)
🔗 Hugging Face Repository:
👉 Fine-tuned Qwen2.5-1.5B-Instruct
How to Use the Model
Using transformers in Python
You may need to install bitsandbytes by using
! pip install -U bitsandbytes
Then you can use the following code to run inference.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# Load model and tokenizer
model_name = "eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Move model to GPU if available
device = "cuda" if torch.cuda.is_available() else "cpu"
model.to(device)
# Example inference
question = "How do I implement a binary search algorithm in Python?"
inputs = tokenizer(question, return_tensors="pt").to(device)
output = model.generate(**inputs, max_length=200)
# Decode response
print(tokenizer.decode(output[0], skip_special_tokens=True))
Running the Model with llama.cpp
Step 1: Install llama.cpp
brew install llama.cpp
Step 2: Download the Model
mkdir -p ~/llama_models && cd ~/llama_models
wget https://huggingface.co/eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1/resolve/main/q8_0.gguf
Step 3: Run the Model
llama-cli -m ~/llama_models/q8_0.gguf --interactive
Or you can use the following:
llama-cli -hf eagle0504/qwen-2_5-1_5b-instruct-using-codealpaca-20k-enhanced-v1:Q8_0
Step 4: Test with a Prompt
llama-cli -m ~/llama_models/q8_0.gguf -p "Explain the differences between breadth-first search and depth-first search."
Training Details
Custom Reward
def count_xml(text: str) -> float:
"""
Calculates a reward based on the occurrence of certain XML tags and subtracts penalties for content after closing tags.
Args:
text (str): The text string to analyze for XML tag consistency.
Returns:
float: Total reward score based on XML tag occurrence and penalties.
"""
count = 0.0
if text.count("<think>\n") == 1:
count += 0.125
if text.count("\n</think>\n") == 1:
count += 0.125
if text.count("\n<answer>\n") == 1:
count += 0.125
count -= len(text.split("\n</answer>\n")[-1])*0.001
if text.count("\n</answer>") == 1:
count += 0.125
count -= (len(text.split("\n</answer>")[-1]) - 1)*0.001
# Ensure `<think>` and `</think>` exist
if "<think>" in text and "</think>" in text:
count += 1.0 # Higher weight to ensure reasoning consistency
else:
count -= 1.0 # Penalize if missing
return count
Each component contributes to the total reward if conditions are met:
| Condition | Reward |
|---|---|
"<think>\n" appears exactly once |
+0.125 |
"\n</think>\n" appears exactly once |
+0.125 |
"\n<answer>\n" appears exactly once |
+0.125 |
"\n</answer>" appears exactly once |
+0.125 |
Both <think> and </think> exist anywhere |
+1.0 |
No extra text after "</answer>" |
No penalty |
Total possible reward before penalties: [ 0.125 + 0.125 + 0.125 + 0.125 + 1.0 = 1.5 ]
Potential Penalties
The function applies penalties for extra content after "</answer>":
[
-\left( \text{length of extra text} \times 0.001 \right)
]
If the best case occurs (i.e., no extra content), then:
- Penalty = 0
- Final Reward = 1.5 (no deductions)
Best Possible Input Example This ideal input gives the highest possible reward:
<think>
Valid reasoning goes here.
</think>
<answer>
Correct final answer here.
</answer>
This means we customize the reward function so that we encourage the answer to have reasoning inside. We also know mathematically what the reward should be so we can monitor it during training process.
Dataset Used
The model was fine-tuned on:
🔹 eagle0504/augmented_codealpaca-20k-using-together-ai-deepseek-v1
This dataset contains:
- 20K augmented training samples
- Features:
instruction,response,cot(Chain-of-Thought)
Training Configuration
- Framework:
transformers+unsloth+trl - Optimization: LoRA applied to QKV projections
- Learning Rate:
1e-6 - AdamW Optimizer (8-bit)
- Mixed Precision (
bf16orfp16) - Batch Size:
8 - Max Sequence Length:
1024
- Downloads last month
- 92