Instructions to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct") model = AutoModelForCausalLM.from_pretrained("gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", 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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
- SGLang
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct 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 "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct" \ --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": "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", "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 "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct" \ --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": "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct with Docker Model Runner:
docker model run hf.co/gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct
Qwen/Qwen2.5-Coder-3B-Instruct distilled from Qwen/Qwen2.5-Coder-32B-Instruct with Ask to Distill.
Ask to Distill trains a question generator with RL so that the questions it writes expose bounded, learnable token-level disagreement between a teacher and a student on the student's own solutions (the same signal on-policy distillation learns from). A question bank is then sampled from the generator, filtered and deduplicated, and the student is trained with on-policy distillation (OPD) on it. No real training questions and no reference answers are used.
Training
| Student | Qwen/Qwen2.5-Coder-3B-Instruct |
| Teacher | Qwen/Qwen2.5-Coder-32B-Instruct |
| Question bank | gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct |
| OPD objective | per-token reverse KL on the student's top-16 tokens, weighted by renormalised student probabilities; no outcome reward |
| OPD recipe | lr 1e-6 (constant), AdamW, rollout temperature 1.0, fp32 master weights / bf16 compute |
Results
| LiveCodeBench v5_v6 | MBPP+ | APPS-Intro | APPS-Interview | APPS-Comp | CodeContests | Avg |
|---|---|---|---|---|---|---|
| 17.0 | 65.1 | 31.6 | 7.6 | 3.7 | 2.4 | 21.2 |
LiveCodeBench v5_v6 (342 problems, n=4, pass@1); MBPP+ (EvalPlus, greedy, lenient answer extraction); APPS intro / interview (1k subset) / competition and CodeContests test (165): n=1, temperature 0.2, top-p 0.95, top-k 20, 4,096 tokens, at most 50 tests per problem. Avg = mean of six.
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "gasolsun/Code_Qwen2.5-Coder-3B-Instruct_Qwen2.5-Coder-32B-Instruct"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype="auto", device_map="auto")
messages = [{"role": "user", "content": "..."}]
inputs = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt").to(model.device)
out = model.generate(inputs, max_new_tokens=4096, do_sample=True, temperature=0.7, top_p=0.95)
print(tok.decode(out[0, inputs.shape[1]:], skip_special_tokens=True))
- Prompts use the LiveCodeBench stdin/stdout template (read from standard input, write to standard output, one fenced Python block).
- Downloads last month
- 77