File size: 2,663 Bytes
f80360c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
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
104
105
106
107
108
109
---
license: apache-2.0
language:
- en
- code
tags:
- stack-2.9
- open-source
- coding-assistant
- fine-tuned
- qwen
- code-generation
library_name: transformers
---

# Stack 2.9 Fine-Tuned Model

A fine-tuned coding assistant model based on {{base_model}}.

## Model Details

| Property | Value |
|----------|-------|
| Base Model | {{base_model}} |
| Training Data | {{training_examples}} examples |
| LoRA Rank | {{lora_rank}} |
| LoRA Alpha | {{lora_alpha}} |
| Max Context Length | {{max_context_length}} |
| License | Apache 2.0 |

## Description

Stack 2.9 is a fine-tuned coding assistant model designed for code generation, refactoring, and software development tasks. The model has been fine-tuned on a curated dataset of high-quality code examples and programming tasks.

### Training Details

- **Dataset**: {{training_examples}} examples from diverse programming domains
- **Fine-tuning Method**: LoRA (Low-Rank Adaptation)
- **LoRA Configuration**: rank={{lora_rank}}, alpha={{lora_alpha}}
- **Base Model**: {{base_model}}

## Benchmarks

| Benchmark | Score |
|-----------|-------|
| HumanEval | {{humaneval_score}} |
| MBPP | {{mbpp_score}} |

## Usage

### Using Transformers

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "your-username/stack-2.9-7b"  # Replace with your repo
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)

prompt = """Write a Python function to calculate the factorial of a number.

```python
"""

inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0]))
```

### Using vLLM for Fast Inference

```python
from vllm import LLM, SamplingParams

llm = LLM(model="your-username/stack-2.9-7b")
sampling_params = SamplingParams(temperature=0.7, max_tokens=200)

prompt = "Write a Python function to reverse a string:"
outputs = llm.generate(prompt, sampling_params)
print(outputs[0].outputs[0].text)
```

## Limitations

- The model may generate incorrect code; always verify outputs
- Performance may vary across different programming languages
- Context window limited to {{max_context_length}} tokens

## License

This model is licensed under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license.

## Citation

If you use this model in your research, please cite:

```bibtex
@misc{stack-2.9,
  author = {Stack Team},
  title = {Stack 2.9: Fine-tuned Coding Assistant},
  year = {2025},
  publisher = {HuggingFace},
  url = {https://huggingface.co/your-username/stack-2.9-7b}
}
```

---

*Model uploaded via upload_hf.py script*