Text Generation
Transformers
Safetensors
English
qwen2
qwen2.5
quantized
4-bit precision
fine-tuned
conversational
text-generation-inference
bitsandbytes
Instructions to use Kholod03/qwen2.5-14b-128LoRA-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kholod03/qwen2.5-14b-128LoRA-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kholod03/qwen2.5-14b-128LoRA-4bit") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kholod03/qwen2.5-14b-128LoRA-4bit") model = AutoModelForCausalLM.from_pretrained("Kholod03/qwen2.5-14b-128LoRA-4bit") 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 Kholod03/qwen2.5-14b-128LoRA-4bit with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kholod03/qwen2.5-14b-128LoRA-4bit" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kholod03/qwen2.5-14b-128LoRA-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kholod03/qwen2.5-14b-128LoRA-4bit
- SGLang
How to use Kholod03/qwen2.5-14b-128LoRA-4bit 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 "Kholod03/qwen2.5-14b-128LoRA-4bit" \ --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": "Kholod03/qwen2.5-14b-128LoRA-4bit", "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 "Kholod03/qwen2.5-14b-128LoRA-4bit" \ --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": "Kholod03/qwen2.5-14b-128LoRA-4bit", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kholod03/qwen2.5-14b-128LoRA-4bit with Docker Model Runner:
docker model run hf.co/Kholod03/qwen2.5-14b-128LoRA-4bit
Qwen2.5-14B Fine-tuned (4-bit Quantized)
This is a 4-bit quantized version of a fine-tuned Qwen2.5-14B model.
Model Details
- Base Model: Qwen/Qwen2.5-14B-Instruct
- Adapter: Kholod03/qwen2.5-14b-128finetuned128LoRA
- Quantization: 4-bit (nf4) with BitsAndBytes
- Size: ~8 GB (compressed from ~28 GB)
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
# Configure 4-bit loading
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
)
# Load model
model = AutoModelForCausalLM.from_pretrained(
"Kholod03/qwen2.5-14b-128LoRA-4bit",
quantization_config=bnb_config,
device_map="auto",
trust_remote_code=True
)
tokenizer = AutoTokenizer.from_pretrained("Kholod03/qwen2.5-14b-128LoRA-4bit")
# Generate
prompt = "Your prompt here"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Requirements
pip install transformers bitsandbytes accelerate
Performance
- Original model: ~28 GB VRAM
- Quantized model: ~8 GB VRAM
- Quality: ~98% of original
- Speed: Faster inference
Training Details
- Method: GRPO with LoRA (rank 128)
- Learning rate: 5e-06
- Batch size: 8
- Max steps: 250
- Downloads last month
- 5