Instructions to use Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT") model = AutoModelForCausalLM.from_pretrained("Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT", 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 Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT
- SGLang
How to use Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT 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 "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT" \ --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": "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT", "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 "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT" \ --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": "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT with Docker Model Runner:
docker model run hf.co/Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT
Qwen3-1.7B Python Code Full SFT
This model is a learning-project checkpoint produced by full supervised fine-tuning of Qwen/Qwen3-1.7B-Base for Python function completion. It is a base-style code completion model: the experiment uses a raw Python prompt, not a chat conversation. Source code, frozen data and per-task evaluation are in the Qwen3 Code Post-Training Lab.
本模型属于代码后训练学习实验。它用于观察同一 Base 模型经过 Full SFT 后,Python 函数题的通过率如何变化;不代表生产级代码助手。
Training
- Base revision:
ea980cb0a6c2ae4b936e82123acc929f1cec04c1. - Data: 26,805 training and 1,386 validation examples filtered from a fixed 100,000-row shard of NVIDIA OpenCodeInstruct. The source dataset is CC BY 4.0; attribution and the exact source revision are recorded in the data lock.
- Single RTX 4090; 1 epoch, 1,676 optimizer steps, effective batch size 16, bf16, max sequence length 1,024, learning rate
2e-5. Loss is computed only on the code completion, not the prompt. - Best validation loss:
0.14692. The final model was selected by validation loss, not by public benchmark score.
Evaluation
| Benchmark | Base | This Full SFT model |
|---|---|---|
| HumanEval+ v0.1.10 | 31/164 (18.9%) | 67/164 (40.9%) |
| MBPP+ v0.2.0 | 214/378 (56.6%) | 229/378 (60.6%) |
Strict pass@1 requires both the original and Plus tests to pass. All stages use the same frozen tasks, raw EvalPlus prompt, one greedy completion per task and at most 512 new tokens. Original completions are judged without code sanitization in a restricted Docker container. Per-task results and the evaluation contract are public.
Load and generate
from transformers import AutoModelForCausalLM, AutoTokenizer
repo = "Eternity5551/Qwen3-1.7B-Python-Code-Full-SFT"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, dtype="auto", device_map="auto").eval()
prompt = '"""\nWrite a Python function double_even(nums) that doubles only even integers.\n"""\n\n'
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
output = model.generate(**inputs, do_sample=False, max_new_tokens=512,
pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0, inputs.input_ids.shape[1]:], skip_special_tokens=True))
The repository contains a standard sharded Transformers model and tokenizer; from_pretrained loads it directly.
Limitations and credits
The evaluation covers public Python function benchmarks only. Prompt overlap filtering cannot exclude every semantic duplicate, and two official benchmark reference solutions failed their own tests in this environment; all models were still scored on the full 164/378 tasks. Do not treat these numbers as a guarantee on unseen software engineering work. Base model: Qwen team, Apache 2.0. Training data: NVIDIA OpenCodeInstruct, CC BY 4.0.
- Downloads last month
- -