Instructions to use KhushalM/Qwen2.5-1.5-SFT-Merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use KhushalM/Qwen2.5-1.5-SFT-Merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="KhushalM/Qwen2.5-1.5-SFT-Merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("KhushalM/Qwen2.5-1.5-SFT-Merged") model = AutoModelForCausalLM.from_pretrained("KhushalM/Qwen2.5-1.5-SFT-Merged", 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use KhushalM/Qwen2.5-1.5-SFT-Merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "KhushalM/Qwen2.5-1.5-SFT-Merged" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "KhushalM/Qwen2.5-1.5-SFT-Merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/KhushalM/Qwen2.5-1.5-SFT-Merged
- SGLang
How to use KhushalM/Qwen2.5-1.5-SFT-Merged 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 "KhushalM/Qwen2.5-1.5-SFT-Merged" \ --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": "KhushalM/Qwen2.5-1.5-SFT-Merged", "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 "KhushalM/Qwen2.5-1.5-SFT-Merged" \ --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": "KhushalM/Qwen2.5-1.5-SFT-Merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use KhushalM/Qwen2.5-1.5-SFT-Merged with Docker Model Runner:
docker model run hf.co/KhushalM/Qwen2.5-1.5-SFT-Merged
KhushalM/Qwen2.5-1.5-SFT-Merged
This is a causal language model fine‑tuned to generate conceptual explanations in the style of Richard Feynman, using supervised learning on curated prompt–completion pairs. It serves as a strong pedagogical baseline before any reinforcement learning stage.
Model Details
Model Description
“KhushalM/Qwen2.5-1.5-SFT-Merged” is built on top of the Qwen/Qwen2.5-1.5B-Instruct base. It was supervised‑finetuned on approximately 750 high‑quality prompt–completion pairs designed to replicate the Feynman teaching approach: simple, first‑principles explanations with concrete analogies, layered structure, and occasional comprehension checks. After finetuning, LoRA adapters were merged for streamlined inference.
- Finetuned by: Khushal Mandavia
- Model type: Decoder‑only transformer (causal LM)
- Finetuned from: Qwen/Qwen2.5-1.5B-Instruct
- Repository: https://huggingface.co/KhushalM/Qwen2.5-1.5-SFT-Merged
Uses
Direct Use
- Conceptual Explanation: Generate analogy‑driven, step‑by‑step explanations of scientific and technical topics.
- Educational Prototyping: Rapidly test teaching content formats or draft study materials.
Downstream Use
- Warm‑start for RL: Serve as the supervised-learning base before reinforcement learning stages.
- Fine‑tuned Deployment: Use in chatbots or tutoring systems requiring clear pedagogical style.
Out‑of‑Scope Use
- High‑stakes Factual Tasks: Not designed for critical decision‑making without verification.
- General Chat: Optimized for explanatory style rather than casual conversation.
Bias, Risks, and Limitations
The model produces engaging and clear explanations but may:
- Overgeneralize: Simplifications can omit important nuances.
- Hallucinate: Introduce plausible but incorrect statements.
- Style Fixation: Rigidly adhere to the Feynman pattern even when another tone is preferable.
Recommendation: Always review outputs for accuracy and context relevance. Consider further domain‑specific finetuning where needed.
How to Get Started with the Model
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
model_id = "KhushalM/Qwen2.5-1.5-SFT-Merged"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype="auto", trust_remote_code=True)
generator = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
device="cuda" # or device="cpu"
)
prompt = "Explain the concept of entropy from first principles."
output = generator(prompt, max_new_tokens=180, temperature=0.7, top_p=0.9)
print(output[0]["generated_text"])
- Downloads last month
- 8