Text Generation
Transformers
Safetensors
English
qwen3
merged
sft
stem
science
education
conversational
text-generation-inference
Instructions to use khadim-hussain/qwen3-14b-stem-qa-merged with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use khadim-hussain/qwen3-14b-stem-qa-merged with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="khadim-hussain/qwen3-14b-stem-qa-merged") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("khadim-hussain/qwen3-14b-stem-qa-merged") model = AutoModelForCausalLM.from_pretrained("khadim-hussain/qwen3-14b-stem-qa-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 khadim-hussain/qwen3-14b-stem-qa-merged with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "khadim-hussain/qwen3-14b-stem-qa-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": "khadim-hussain/qwen3-14b-stem-qa-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/khadim-hussain/qwen3-14b-stem-qa-merged
- SGLang
How to use khadim-hussain/qwen3-14b-stem-qa-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 "khadim-hussain/qwen3-14b-stem-qa-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": "khadim-hussain/qwen3-14b-stem-qa-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 "khadim-hussain/qwen3-14b-stem-qa-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": "khadim-hussain/qwen3-14b-stem-qa-merged", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use khadim-hussain/qwen3-14b-stem-qa-merged with Docker Model Runner:
docker model run hf.co/khadim-hussain/qwen3-14b-stem-qa-merged
Qwen3-14B STEM Q&A (Merged)
This is the merged full model (LoRA weights merged into base model) for standalone use.
Author: Khadim Hussain
For the LoRA adapter version (smaller download), see: khadim-hussain/qwen3-14b-stem-qa
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained(
"khadim-hussain/qwen3-14b-stem-qa-merged",
torch_dtype="auto",
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained("khadim-hussain/qwen3-14b-stem-qa-merged")
prompt = "<|im_start|>user\nWhat is DNA?<|im_end|>\n<|im_start|>assistant\n"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Model Details
- Base Model: Qwen/Qwen3-14B
- Type: Merged (LoRA merged into base weights)
- Size: ~28GB (bf16)
- Training: QLoRA fine-tuning on STEM Q&A dataset
Training Metrics
| Metric | Value |
|---|---|
| Train Loss | 0.461 |
| Eval Loss | 0.692 |
| Training Examples | 4,260 |
| Evaluation Examples | 474 |
Acknowledgments
- Qwen Team (Alibaba) - Qwen3-14B base model
- Unsloth - Fast fine-tuning framework
- Hugging Face - TRL, PEFT, Transformers
License
Apache 2.0 (inherited from Qwen3)
- Downloads last month
- 5