Update README.md
Browse files
README.md
CHANGED
|
@@ -1,199 +1,196 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
| 2 |
library_name: transformers
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
---
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
<!-- Provide a quick summary of what the model is/does. -->
|
| 9 |
|
|
|
|
| 10 |
|
|
|
|
| 11 |
|
| 12 |
## Model Details
|
| 13 |
|
| 14 |
### Model Description
|
| 15 |
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
- **
|
| 21 |
-
- **
|
| 22 |
-
- **
|
| 23 |
-
- **
|
| 24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
| 25 |
-
- **License:** [More Information Needed]
|
| 26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
| 27 |
|
| 28 |
-
###
|
| 29 |
|
| 30 |
-
|
| 31 |
|
| 32 |
-
|
| 33 |
-
- **Paper [optional]:** [More Information Needed]
|
| 34 |
-
- **Demo [optional]:** [More Information Needed]
|
| 35 |
|
| 36 |
-
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
### Direct Use
|
| 41 |
|
| 42 |
-
|
| 43 |
|
| 44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 45 |
|
| 46 |
-
### Downstream Use
|
| 47 |
|
| 48 |
-
|
| 49 |
|
| 50 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
|
| 52 |
### Out-of-Scope Use
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
[More Information Needed]
|
| 57 |
-
|
| 58 |
-
## Bias, Risks, and Limitations
|
| 59 |
-
|
| 60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
| 61 |
|
| 62 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
|
| 64 |
-
##
|
| 65 |
-
|
| 66 |
-
<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
|
| 67 |
|
| 68 |
-
|
| 69 |
|
| 70 |
-
|
| 71 |
|
| 72 |
-
|
| 73 |
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
|
|
|
|
|
|
| 77 |
|
| 78 |
### Training Data
|
| 79 |
|
| 80 |
-
|
| 81 |
|
| 82 |
-
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
|
| 86 |
-
|
|
|
|
|
|
|
| 87 |
|
| 88 |
-
|
| 89 |
|
| 90 |
-
|
| 91 |
|
|
|
|
| 92 |
|
| 93 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
|
| 95 |
-
|
| 96 |
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
|
| 101 |
-
|
| 102 |
|
| 103 |
## Evaluation
|
| 104 |
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
### Testing Data, Factors & Metrics
|
| 108 |
-
|
| 109 |
-
#### Testing Data
|
| 110 |
-
|
| 111 |
-
<!-- This should link to a Dataset Card if possible. -->
|
| 112 |
-
|
| 113 |
-
[More Information Needed]
|
| 114 |
-
|
| 115 |
-
#### Factors
|
| 116 |
-
|
| 117 |
-
<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
|
| 118 |
-
|
| 119 |
-
[More Information Needed]
|
| 120 |
-
|
| 121 |
-
#### Metrics
|
| 122 |
-
|
| 123 |
-
<!-- These are the evaluation metrics being used, ideally with a description of why. -->
|
| 124 |
-
|
| 125 |
-
[More Information Needed]
|
| 126 |
-
|
| 127 |
-
### Results
|
| 128 |
-
|
| 129 |
-
[More Information Needed]
|
| 130 |
-
|
| 131 |
-
#### Summary
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
## Model Examination [optional]
|
| 136 |
-
|
| 137 |
-
<!-- Relevant interpretability work for the model goes here -->
|
| 138 |
-
|
| 139 |
-
[More Information Needed]
|
| 140 |
-
|
| 141 |
-
## Environmental Impact
|
| 142 |
-
|
| 143 |
-
<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
|
| 144 |
-
|
| 145 |
-
Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
|
| 146 |
-
|
| 147 |
-
- **Hardware Type:** [More Information Needed]
|
| 148 |
-
- **Hours used:** [More Information Needed]
|
| 149 |
-
- **Cloud Provider:** [More Information Needed]
|
| 150 |
-
- **Compute Region:** [More Information Needed]
|
| 151 |
-
- **Carbon Emitted:** [More Information Needed]
|
| 152 |
-
|
| 153 |
-
## Technical Specifications [optional]
|
| 154 |
-
|
| 155 |
-
### Model Architecture and Objective
|
| 156 |
-
|
| 157 |
-
[More Information Needed]
|
| 158 |
-
|
| 159 |
-
### Compute Infrastructure
|
| 160 |
-
|
| 161 |
-
[More Information Needed]
|
| 162 |
-
|
| 163 |
-
#### Hardware
|
| 164 |
-
|
| 165 |
-
[More Information Needed]
|
| 166 |
|
| 167 |
-
|
| 168 |
|
| 169 |
-
|
|
|
|
|
|
|
| 170 |
|
| 171 |
-
|
| 172 |
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
| 176 |
|
| 177 |
-
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
-
|
| 180 |
|
| 181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 182 |
|
| 183 |
-
|
| 184 |
|
| 185 |
-
|
| 186 |
|
| 187 |
-
|
| 188 |
|
| 189 |
-
|
|
|
|
|
|
|
| 190 |
|
| 191 |
-
|
| 192 |
|
| 193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
|
| 195 |
-
|
|
|
|
| 196 |
|
| 197 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
|
| 199 |
-
[
|
|
|
|
| 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 |
---
|
| 23 |
|
| 24 |
+
# Hunyuan-PythonGOD-0.5B
|
|
|
|
|
|
|
| 25 |
|
| 26 |
+
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.
|
| 27 |
|
| 28 |
+
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.
|
| 29 |
|
| 30 |
## Model Details
|
| 31 |
|
| 32 |
### Model Description
|
| 33 |
|
| 34 |
+
- **Model name:** `gss1147/Hunyuan-PythonGOD-0.5B`
|
| 35 |
+
- **Base model:** `tencent/Hunyuan-0.5B-Instruct`
|
| 36 |
+
- **Architecture:** causal decoder-only language model
|
| 37 |
+
- **Model family tag:** `hunyuan_v1_dense`
|
| 38 |
+
- **Primary domain:** Python coding / coding assistant
|
| 39 |
+
- **Parameter count:** ~0.5B
|
| 40 |
+
- **Weights format:** safetensors
|
| 41 |
+
- **Tensor type in repo:** F16
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
+
### Developed by
|
| 44 |
|
| 45 |
+
- **Shared by:** `gss1147`
|
| 46 |
|
| 47 |
+
### Finetuned from model
|
|
|
|
|
|
|
| 48 |
|
| 49 |
+
- `tencent/Hunyuan-0.5B-Instruct`
|
| 50 |
|
| 51 |
+
## Intended Uses
|
| 52 |
|
| 53 |
### Direct Use
|
| 54 |
|
| 55 |
+
This model is intended for:
|
| 56 |
|
| 57 |
+
- Python function generation
|
| 58 |
+
- Python script writing
|
| 59 |
+
- debugging-oriented coding help
|
| 60 |
+
- implementation tasks
|
| 61 |
+
- code completion
|
| 62 |
+
- coding chat assistants
|
| 63 |
+
- lightweight local or cloud inference where a small coding model is preferred
|
| 64 |
|
| 65 |
+
### Downstream Use
|
| 66 |
|
| 67 |
+
Possible downstream uses include:
|
| 68 |
|
| 69 |
+
- code copilots
|
| 70 |
+
- coding bots
|
| 71 |
+
- Python tutoring helpers
|
| 72 |
+
- automation script generation
|
| 73 |
+
- benchmark experimentation for small code LLMs
|
| 74 |
|
| 75 |
### Out-of-Scope Use
|
| 76 |
|
| 77 |
+
This model is not designed for:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
|
| 79 |
+
- safety-critical code deployment without human review
|
| 80 |
+
- medical, legal, or financial decision support
|
| 81 |
+
- secure production code without auditing
|
| 82 |
+
- autonomous execution pipelines without sandboxing
|
| 83 |
+
- guaranteed factual or bug-free code generation
|
| 84 |
|
| 85 |
+
## Training Details
|
|
|
|
|
|
|
| 86 |
|
| 87 |
+
### Training Objective
|
| 88 |
|
| 89 |
+
This model was trained as a **full fine-tune**, not as an adapter-only release.
|
| 90 |
|
| 91 |
+
Based on the training workflow you described and the run logs you shared, this release is meant to represent:
|
| 92 |
|
| 93 |
+
- **full-parameter fine-tuning**
|
| 94 |
+
- **no LoRA**
|
| 95 |
+
- **no QLoRA**
|
| 96 |
+
- **no PEFT adapters in the final model**
|
| 97 |
+
- **standard exported Hugging Face model weights**
|
| 98 |
|
| 99 |
### Training Data
|
| 100 |
|
| 101 |
+
This model was trained on the following datasets:
|
| 102 |
|
| 103 |
+
- `WithinUsAI/Python_GOD_Coder_Omniforge_AI_12k`
|
| 104 |
+
- `WithinUsAI/Python_GOD_Coder_5k`
|
| 105 |
+
- `WithinUsAI/Legend_Python_CoderV.1`
|
| 106 |
|
| 107 |
+
From the training logs you shared, the combined training corpus used:
|
| 108 |
|
| 109 |
+
- **11,760 rows** from `Python_GOD_Coder_Omniforge_AI_12k`
|
| 110 |
+
- **5,000 rows** from `Python_GOD_Coder_5k`
|
| 111 |
+
- **5,000 rows** from `Legend_Python_CoderV.1`
|
| 112 |
|
| 113 |
+
**Total rows:** **21,760**
|
| 114 |
|
| 115 |
+
### Training Procedure
|
| 116 |
|
| 117 |
+
From the training setup you shared, this model was trained with:
|
| 118 |
|
| 119 |
+
- **dual-GPU Kaggle training**
|
| 120 |
+
- **DeepSpeed-assisted distributed training**
|
| 121 |
+
- **full model fine-tuning**
|
| 122 |
+
- **evaluation during training**
|
| 123 |
+
- **final-save upload flow to Hugging Face**
|
| 124 |
|
| 125 |
+
### Sequence Length
|
| 126 |
|
| 127 |
+
- **Practical fine-tuning sequence length:** 4096 tokens
|
| 128 |
|
| 129 |
+
### Context Window Note
|
| 130 |
|
| 131 |
+
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.
|
| 132 |
|
| 133 |
## Evaluation
|
| 134 |
|
| 135 |
+
Formal benchmark results are not finalized in this card.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 136 |
|
| 137 |
+
Benchmark attempts were made on free public coding benchmarks such as:
|
| 138 |
|
| 139 |
+
- HumanEval+
|
| 140 |
+
- MBPP+
|
| 141 |
+
- BigCodeBench-style workflows
|
| 142 |
|
| 143 |
+
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.
|
| 144 |
|
| 145 |
+
### Observed Training Behavior
|
| 146 |
|
| 147 |
+
From the run logs you shared during training, the model showed:
|
| 148 |
|
| 149 |
+
- strong reduction in training loss over time
|
| 150 |
+
- strong reduction in eval loss over time
|
| 151 |
+
- stable continued learning well into the run
|
| 152 |
+
- increasingly code-specialized behavior relative to the base model
|
| 153 |
|
| 154 |
+
Examples from your shared eval progression included values around:
|
| 155 |
|
| 156 |
+
- ~0.2879 early in training
|
| 157 |
+
- ~0.1071
|
| 158 |
+
- ~0.0604
|
| 159 |
+
- ~0.0550
|
| 160 |
+
- ~0.0422
|
| 161 |
+
- ~0.0329
|
| 162 |
+
- ~0.0266
|
| 163 |
+
- ~0.0299
|
| 164 |
+
- ~0.0290
|
| 165 |
|
| 166 |
+
These are training/eval-run observations, not official public benchmark scores.
|
| 167 |
|
| 168 |
+
## How to Use
|
| 169 |
|
| 170 |
+
### Transformers
|
| 171 |
|
| 172 |
+
```python
|
| 173 |
+
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 174 |
+
import torch
|
| 175 |
|
| 176 |
+
model_id = "gss1147/Hunyuan-PythonGOD-0.5B"
|
| 177 |
|
| 178 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
| 179 |
+
model = AutoModelForCausalLM.from_pretrained(
|
| 180 |
+
model_id,
|
| 181 |
+
trust_remote_code=True,
|
| 182 |
+
torch_dtype=torch.float16,
|
| 183 |
+
device_map="auto",
|
| 184 |
+
)
|
| 185 |
|
| 186 |
+
prompt = "Write a Python function that merges overlapping intervals."
|
| 187 |
+
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 188 |
|
| 189 |
+
with torch.no_grad():
|
| 190 |
+
outputs = model.generate(
|
| 191 |
+
**inputs,
|
| 192 |
+
max_new_tokens=512,
|
| 193 |
+
do_sample=False,
|
| 194 |
+
)
|
| 195 |
|
| 196 |
+
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
|