Instructions to use gloraia/cyqwen-0.6b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gloraia/cyqwen-0.6b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gloraia/cyqwen-0.6b") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gloraia/cyqwen-0.6b") model = AutoModelForCausalLM.from_pretrained("gloraia/cyqwen-0.6b", 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 gloraia/cyqwen-0.6b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gloraia/cyqwen-0.6b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gloraia/cyqwen-0.6b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gloraia/cyqwen-0.6b
- SGLang
How to use gloraia/cyqwen-0.6b 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 "gloraia/cyqwen-0.6b" \ --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": "gloraia/cyqwen-0.6b", "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 "gloraia/cyqwen-0.6b" \ --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": "gloraia/cyqwen-0.6b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gloraia/cyqwen-0.6b with Docker Model Runner:
docker model run hf.co/gloraia/cyqwen-0.6b
cyqwen-0.6b
cyqwen-0.6b is a fine-tuned model based on Qwen/Qwen3-0.6B. The model is trained for a course project that focuses on improving safety alignment and mathematical reasoning while keeping general instruction-following ability stable.
The submitted repository contains the merged full model weights, so it can be loaded directly with Hugging Face Transformers without an additional LoRA adapter.
Base Model
- Base model:
Qwen/Qwen3-0.6B - Model type: causal language model
- Fine-tuning method: LoRA supervised fine-tuning, merged into the base model after training
- Model scale: kept at the original Qwen3-0.6B scale
Training Data
The training data was reconstructed from multiple instruction, safety, and math sources:
allenai/wildguardmixHuggingFaceH4/ultrachat_200kmeta-math/MetaMathQAopenai/gsm8kChilleD/SVAMPnvidia/OpenMathInstruct-1- internally constructed math reasoning distillation data based on cleaned math prompts
The final SFT mixture balances harmful-request refusal, benign-request compliance, mathematical reasoning, and general instruction following.
Usage
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer
model_id = "gloraia/cyqwen-0.6b"
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
trust_remote_code=True,
)
messages = [
{"role": "user", "content": "Solve: If 3x + 5 = 20, what is x?"}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True,
)
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**inputs,
max_new_tokens=512,
do_sample=True,
temperature=0.6,
top_p=0.95,
top_k=20,
)
print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:], skip_special_tokens=True))
Notes
This model is intended for educational evaluation on safety alignment and math reasoning. It may still produce incorrect answers or imperfect refusals, so outputs should be reviewed before use in high-stakes settings.
- Downloads last month
- 52