Instructions to use sainiswayam9/qwen-lora-chatbot with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use sainiswayam9/qwen-lora-chatbot with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-0.5B") model = PeftModel.from_pretrained(base_model, "sainiswayam9/qwen-lora-chatbot") - Transformers
How to use sainiswayam9/qwen-lora-chatbot with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sainiswayam9/qwen-lora-chatbot") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("sainiswayam9/qwen-lora-chatbot", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sainiswayam9/qwen-lora-chatbot with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sainiswayam9/qwen-lora-chatbot" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sainiswayam9/qwen-lora-chatbot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/sainiswayam9/qwen-lora-chatbot
- SGLang
How to use sainiswayam9/qwen-lora-chatbot 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 "sainiswayam9/qwen-lora-chatbot" \ --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": "sainiswayam9/qwen-lora-chatbot", "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 "sainiswayam9/qwen-lora-chatbot" \ --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": "sainiswayam9/qwen-lora-chatbot", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use sainiswayam9/qwen-lora-chatbot with Docker Model Runner:
docker model run hf.co/sainiswayam9/qwen-lora-chatbot
Qwen LoRA Chatbot
A LoRA fine-tuned version of Qwen/Qwen2.5-0.5B trained on instruction-following data using PEFT and TRL.
Model Details
Developed By
Swayam Saini
Model Type
PEFT / LoRA Adapter for Causal Language Modeling
Base Model
Qwen/Qwen2.5-0.5B
Language
English
Frameworks
- Transformers
- PEFT
- TRL
PEFT Version
0.19.1
Training Dataset
Dataset used:
yahma/alpaca-cleaned
The dataset contains instruction-response pairs designed to improve instruction-following behavior.
Fine-Tuning Configuration
- LoRA Rank (r): 16
- LoRA Alpha: 32
- LoRA Dropout: 0.05
- Precision: FP16
- Trainer: TRL SFTTrainer
Model Architecture
This repository contains a LoRA adapter trained on top of:
Qwen/Qwen2.5-0.5B
The final chatbot is created by combining:
Base Model + LoRA Adapter
Files
- adapter_model.safetensors
- adapter_config.json
- tokenizer.json
- tokenizer_config.json
- chat_template.jinja
Intended Use
This model can be used for:
- Conversational AI
- Chatbots
- Question Answering
- Educational demonstrations
- LLM fine-tuning experiments
Limitations
This model may:
- Hallucinate facts
- Produce inaccurate information
- Reflect biases present in training data
Outputs should be reviewed before use in production systems.
Deployment
The adapter can be loaded using:
from transformers import AutoModelForCausalLM
from peft import PeftModel
base_model = AutoModelForCausalLM.from_pretrained(
"Qwen/Qwen2.5-0.5B"
)
model = PeftModel.from_pretrained(
base_model,
"sainiswayam9/qwen-lora-chatbot"
)
Project Summary
This project demonstrates:
- LoRA fine-tuning
- Parameter-efficient training
- Hugging Face Model Hub integration
- Hugging Face Space deployment
- End-to-end LLM workflow
Author
Swayam Saini
- Downloads last month
- 40
Model tree for sainiswayam9/qwen-lora-chatbot
Base model
Qwen/Qwen2.5-0.5B