File size: 3,716 Bytes
f4c0ee7
 
e96de39
 
 
 
 
 
 
 
 
 
 
 
 
f4c0ee7
 
e96de39
f4c0ee7
e96de39
f4c0ee7
e96de39
f4c0ee7
e96de39
 
 
 
65ac950
e96de39
 
f4c0ee7
e96de39
f4c0ee7
e96de39
f4c0ee7
e96de39
65ac950
 
 
f4c0ee7
e96de39
f4c0ee7
e96de39
 
 
 
 
 
 
 
 
 
 
f4c0ee7
65ac950
 
 
 
e96de39
f4c0ee7
e96de39
 
 
 
f4c0ee7
e96de39
 
f4c0ee7
e96de39
 
 
 
 
 
 
f4c0ee7
e96de39
 
 
 
 
f4c0ee7
e96de39
 
f4c0ee7
e96de39
 
 
f4c0ee7
e96de39
 
65ac950
e96de39
 
 
f4c0ee7
65ac950
f4c0ee7
65ac950
 
 
 
 
 
f4c0ee7
65ac950
f4c0ee7
65ac950
 
 
f4c0ee7
e96de39
f4c0ee7
e96de39
 
 
 
 
65ac950
e96de39
 
65ac950
 
e96de39
f4c0ee7
e96de39
f4c0ee7
65ac950
e96de39
 
 
 
 
f4c0ee7
65ac950
e96de39
 
 
 
 
 
 
 
 
 
 
f4c0ee7
e96de39
f4c0ee7
e96de39
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
---
library_name: transformers
tags:
- code
- coding
- software-development
- programming
- llm
- python
- qwen
- transformers
- peft
- lora
- finetuned
license: apache-2.0
---

# 🤖 MM Coder Agent v1

A professional AI coding assistant model fine-tuned from Qwen2.5-1.5B-Instruct for software development tasks.

## Model Overview

| Property | Value |
|----------|-------|
| **Base Model** | Qwen/Qwen2.5-1.5B-Instruct |
| **Architecture** | LoRA (PEFT Adapter) |
| **Parameters** | 1.5B (base) + 37MB (adapter) |
| **Task** | Code Generation / Software Development |
| **Framework** | Transformers, Safetensors |

## Model Description

MM Coder Agent v1 is a specialized coding assistant built on Qwen2.5-1.5B-Instruct. This model is optimized for:

- **Code Generation** - Generate clean, efficient code in multiple languages
- **Bug Detection** - Identify and fix common programming errors
- **Algorithm Implementation** - Implement sorting, searching, and data structures
- **Code Review** - Assist with code review and best practices

### Architecture Details

```json
{
  "peft_type": "LORA",
  "base_model_name_or_path": "Qwen/Qwen2.5-1.5B-Instruct",
  "r": 16,
  "lora_alpha": 32,
  "lora_dropout": 0.0,
  "task_type": "CAUSAL_LM",
  "target_modules": ["q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj"]
}
```

## Live Demo

Try the model live at: [mm-coder-v1-space](https://huggingface.co/spaces/amkyawdev/mm-coder-v1-space)

## Quick Start

```python
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
from peft import PeftModel, PeftConfig

# Load adapter config
peft_config = PeftConfig.from_pretrained("amkyawdev/mm-coder-agent-v1-combined")

# Load base model
base_model = AutoModelForCausalLM.from_pretrained(
    peft_config.base_model_name_or_path,
    torch_dtype=torch.float16,
    device_map="auto",
    trust_remote_code=True
).eval()

# Load tokenizer
tokenizer = AutoTokenizer.from_pretrained(
    peft_config.base_model_name_or_path,
    trust_remote_code=True
)

# Load LoRA adapter
model = PeftModel.from_pretrained(base_model, "amkyawdev/mm-coder-agent-v1-combined")

# Generate code
prompt = "Write a Python function to calculate fibonacci numbers"
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)

with torch.no_grad():
    outputs = model.generate(**inputs, max_new_tokens=512, temperature=0.7)

response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
```

## Example Outputs

| Prompt | Output |
|--------|--------|
| `python hello world` | `print("Hello, World!")` |
| `reverse string python` | `s[::-1]` |
| `fibonacci function python` | Full fibonacci implementation |
| `bubble sort python` | Bubble sort algorithm |

## Training Data

- **Dataset**: mm-llm-coder-dataset (4M rows)
- **Additional**: mm-llm-coder-agent-dataset (4M rows)
- **Source**: Quality coding prompts and responses

## Use Cases

### Ideal For
- Code completion and generation
- Bug detection and fixing
- Algorithm implementation
- Learning programming concepts
- Quick prototyping

### Not Recommended For
- Production-critical systems without evaluation
- Security-sensitive applications without guardrails
- Tasks beyond software development

## Limitations

- 1.5B parameter model (smaller than GPT-4 class)
- May produce incorrect code - always verify outputs
- Limited context window
- Fine-tuned primarily for English

## License

Apache 2.0

## Citation

```bibtex
@model{amkyawdev/mm-coder-agent-v1-combined,
  title={MM Coder Agent v1},
  author={amkyawdev},
  year={2024},
  url={https://huggingface.co/amkyawdev/mm-coder-agent-v1-combined}
}
```

---

*Built with ❤️ using Transformers and PEFT*