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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: other
|
| 5 |
+
library_name: transformers
|
| 6 |
+
pipeline_tag: text-generation
|
| 7 |
+
tags:
|
| 8 |
+
- python
|
| 9 |
+
- code-generation
|
| 10 |
+
- code-assistant
|
| 11 |
+
- causal-lm
|
| 12 |
+
- full-finetune
|
| 13 |
+
- hunyuan
|
| 14 |
+
- transformers
|
| 15 |
+
- safetensors
|
| 16 |
+
- instruct
|
| 17 |
+
base_model:
|
| 18 |
+
- tencent/Hunyuan-0.5B-Instruct
|
| 19 |
+
model-index:
|
| 20 |
+
- name: Hunyuan-PythonGOD-0.5B
|
| 21 |
+
results: []
|
| 22 |
+
datasets:
|
| 23 |
+
- WithinUsAI/Python_GOD_Coder_Omniforge_AI_12k
|
| 24 |
+
- WithinUsAI/Python_GOD_Coder_5k
|
| 25 |
+
- WithinUsAI/Legend_Python_CoderV.1
|
| 26 |
+
---
|
| 27 |
+
|
| 28 |
+
# Hunyuan-PythonGOD-0.5B
|
| 29 |
+
|
| 30 |
+
Hunyuan-PythonGOD-0.5B is a Python-focused full fine-tune of `tencent/Hunyuan-0.5B-Instruct`, built for code generation, coding assistance, implementation tasks, and instruction-following for Python-heavy workflows.
|
| 31 |
+
|
| 32 |
+
This release is intended as a compact coding model that keeps the small footprint of the 0.5B Hunyuan base while shifting its behavior toward practical Python generation and code-oriented responses.
|
| 33 |
+
|
| 34 |
+
## Model Details
|
| 35 |
+
|
| 36 |
+
### Model Description
|
| 37 |
+
|
| 38 |
+
- **Model name:** `gss1147/Hunyuan-PythonGOD-0.5B`
|
| 39 |
+
- **Base model:** `tencent/Hunyuan-0.5B-Instruct`
|
| 40 |
+
- **Architecture:** causal decoder-only language model
|
| 41 |
+
- **Model family tag:** `hunyuan_v1_dense`
|
| 42 |
+
- **Primary domain:** Python coding / coding assistant
|
| 43 |
+
- **Parameter count:** ~0.5B
|
| 44 |
+
- **Weights format:** safetensors
|
| 45 |
+
- **Tensor type in repo:** F16
|
| 46 |
+
|
| 47 |
+
### Developed by
|
| 48 |
+
|
| 49 |
+
- **Shared by:** `gss1147`
|
| 50 |
+
|
| 51 |
+
### Finetuned from model
|
| 52 |
+
|
| 53 |
+
- `tencent/Hunyuan-0.5B-Instruct`
|
| 54 |
+
|
| 55 |
+
## Intended Uses
|
| 56 |
+
|
| 57 |
+
### Direct Use
|
| 58 |
+
|
| 59 |
+
This model is intended for:
|
| 60 |
+
|
| 61 |
+
- Python function generation
|
| 62 |
+
- Python script writing
|
| 63 |
+
- debugging-oriented coding help
|
| 64 |
+
- implementation tasks
|
| 65 |
+
- code completion
|
| 66 |
+
- coding chat assistants
|
| 67 |
+
- lightweight local or cloud inference where a small coding model is preferred
|
| 68 |
+
|
| 69 |
+
### Downstream Use
|
| 70 |
+
|
| 71 |
+
Possible downstream uses include:
|
| 72 |
+
|
| 73 |
+
- code copilots
|
| 74 |
+
- coding bots
|
| 75 |
+
- Python tutoring helpers
|
| 76 |
+
- automation script generation
|
| 77 |
+
- benchmark experimentation for small code LLMs
|
| 78 |
+
|
| 79 |
+
### Out-of-Scope Use
|
| 80 |
+
|
| 81 |
+
This model is not designed for:
|
| 82 |
+
|
| 83 |
+
- safety-critical code deployment without human review
|
| 84 |
+
- medical, legal, or financial decision support
|
| 85 |
+
- secure production code without auditing
|
| 86 |
+
- autonomous execution pipelines without sandboxing
|
| 87 |
+
- guaranteed factual or bug-free code generation
|
| 88 |
+
|
| 89 |
+
## Training Details
|
| 90 |
+
|
| 91 |
+
### Training Objective
|
| 92 |
+
|
| 93 |
+
This model was trained as a **full fine-tune**, not as an adapter-only release.
|
| 94 |
+
|
| 95 |
+
Based on the training workflow you described and the run logs you shared, this release is meant to represent:
|
| 96 |
+
|
| 97 |
+
- **full-parameter fine-tuning**
|
| 98 |
+
- **no LoRA**
|
| 99 |
+
- **no QLoRA**
|
| 100 |
+
- **no PEFT adapters in the final model**
|
| 101 |
+
- **standard exported Hugging Face model weights**
|
| 102 |
+
|
| 103 |
+
### Training Data
|
| 104 |
+
|
| 105 |
+
This model was trained on the following datasets:
|
| 106 |
+
|
| 107 |
+
- `WithinUsAI/Python_GOD_Coder_Omniforge_AI_12k`
|
| 108 |
+
- `WithinUsAI/Python_GOD_Coder_5k`
|
| 109 |
+
- `WithinUsAI/Legend_Python_CoderV.1`
|
| 110 |
+
|
| 111 |
+
From the training logs you shared, the combined training corpus used:
|
| 112 |
+
|
| 113 |
+
- **11,760 rows** from `Python_GOD_Coder_Omniforge_AI_12k`
|
| 114 |
+
- **5,000 rows** from `Python_GOD_Coder_5k`
|
| 115 |
+
- **5,000 rows** from `Legend_Python_CoderV.1`
|
| 116 |
+
|
| 117 |
+
**Total rows:** **21,760**
|
| 118 |
+
|
| 119 |
+
### Training Procedure
|
| 120 |
+
|
| 121 |
+
From the training setup you shared, this model was trained with:
|
| 122 |
+
|
| 123 |
+
- **dual-GPU Kaggle training**
|
| 124 |
+
- **DeepSpeed-assisted distributed training**
|
| 125 |
+
- **full model fine-tuning**
|
| 126 |
+
- **evaluation during training**
|
| 127 |
+
- **final-save upload flow to Hugging Face**
|
| 128 |
+
|
| 129 |
+
### Sequence Length
|
| 130 |
+
|
| 131 |
+
- **Practical fine-tuning sequence length:** 4096 tokens
|
| 132 |
+
|
| 133 |
+
### Context Window Note
|
| 134 |
+
|
| 135 |
+
If the base model family exposes larger context metadata in config fields, that should not be taken as proof that the full fine-tuning run itself was performed at that larger length. This release should be treated as fine-tuned at **4096 tokens** unless revalidated separately.
|
| 136 |
+
|
| 137 |
+
## Evaluation
|
| 138 |
+
|
| 139 |
+
Formal benchmark results are not finalized in this card.
|
| 140 |
+
|
| 141 |
+
Benchmark attempts were made on free public coding benchmarks such as:
|
| 142 |
+
|
| 143 |
+
- HumanEval+
|
| 144 |
+
- MBPP+
|
| 145 |
+
- BigCodeBench-style workflows
|
| 146 |
+
|
| 147 |
+
However, based on the evaluation runs you shared, the harness setup encountered tool/runtime issues during some benchmark attempts, so this card does **not** claim final official benchmark scores yet.
|
| 148 |
+
|
| 149 |
+
### Observed Training Behavior
|
| 150 |
+
|
| 151 |
+
From the run logs you shared during training, the model showed:
|
| 152 |
+
|
| 153 |
+
- strong reduction in training loss over time
|
| 154 |
+
- strong reduction in eval loss over time
|
| 155 |
+
- stable continued learning well into the run
|
| 156 |
+
- increasingly code-specialized behavior relative to the base model
|
| 157 |
+
|
| 158 |
+
Examples from your shared eval progression included values around:
|
| 159 |
+
|
| 160 |
+
- ~0.2879 early in training
|
| 161 |
+
- ~0.1071
|
| 162 |
+
- ~0.0604
|
| 163 |
+
- ~0.0550
|
| 164 |
+
- ~0.0422
|
| 165 |
+
- ~0.0329
|
| 166 |
+
- ~0.0266
|
| 167 |
+
- ~0.0299
|
| 168 |
+
- ~0.0290
|
| 169 |
+
|
| 170 |
+
These are training/eval-run observations, not official public benchmark scores.
|
| 171 |
+
|
| 172 |
+
## How to Use
|
| 173 |
+
|
| 174 |
+
### Transformers
|
| 175 |
+
|
| 176 |
+
```python
|
| 177 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 178 |
+
import torch
|
| 179 |
+
|
| 180 |
+
model_id = "gss1147/Hunyuan-PythonGOD-0.5B"
|
| 181 |
+
|
| 182 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 183 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 184 |
+
model_id,
|
| 185 |
+
trust_remote_code=True,
|
| 186 |
+
torch_dtype=torch.float16,
|
| 187 |
+
device_map="auto",
|
| 188 |
+
)
|
| 189 |
+
|
| 190 |
+
prompt = "Write a Python function that merges overlapping intervals."
|
| 191 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 192 |
+
|
| 193 |
+
with torch.no_grad():
|
| 194 |
+
outputs = model.generate(
|
| 195 |
+
**inputs,
|
| 196 |
+
max_new_tokens=512,
|
| 197 |
+
do_sample=False,
|
| 198 |
+
)
|
| 199 |
+
|
| 200 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|