LE Quoc Dat commited on
Commit
d379b03
·
verified ·
1 Parent(s): b792d40

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +95 -6
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- base_model: unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit
3
  language:
4
  - en
5
  license: apache-2.0
@@ -10,14 +10,103 @@ tags:
10
  - qwen2
11
  - trl
12
  - sft
 
 
13
  ---
14
 
15
- # Uploaded model
16
 
17
- - **Developed by:** quocdat25
 
 
 
 
 
 
 
18
  - **License:** apache-2.0
19
- - **Finetuned from model :** unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
 
21
- This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
 
22
 
23
- [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
 
1
  ---
2
+ base_model: unsloth/qwen2.5-coder-1.5b-instruct-bnb-4bit
3
  language:
4
  - en
5
  license: apache-2.0
 
10
  - qwen2
11
  - trl
12
  - sft
13
+ - fast-apply
14
+ - instant-apply
15
  ---
16
 
17
+ # FastApply-1.5B-v1.0
18
 
19
+ [Github: kortix-ai/fast-apply](https://github.com/kortix-ai/fast-apply)
20
+ [Dataset: Kortix/FastApply-dataset-v1.0](https://huggingface.co/datasets/Kortix/FastApply-dataset-v1.0)
21
+
22
+ ## Model Details
23
+
24
+ ### Basic Information
25
+
26
+ - **Developed by:** Kortix
27
  - **License:** apache-2.0
28
+ - **Finetuned from model:** [unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit](https://huggingface.co/unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit)
29
+
30
+ ### Model Description
31
+
32
+ FastApply-1.5B-v1.0 is a 1.5B model designed for instant code application, producing full file edits to power [SoftGen AI](https://softgen.ai/).
33
+ It is part of the Fast Apply pipeline for data generation and fine-tuning Qwen2.5 Coder models.
34
+
35
+ The model achieves high throughput when deployed on fast providers like Fireworks while maintaining high edit accuracy, with a speed of approximately 150 tokens/second.
36
+
37
+ ## Intended Use
38
+
39
+ FastApply-1.5B-v1.0 is intended for use in AI-powered code editors and tools that require fast, accurate code modifications. It is particularly well-suited for:
40
+
41
+ - Instant code application tasks
42
+ - Full file edits
43
+ - Integration with AI-powered code editors like Aider and PearAI
44
+ - Local tools to reduce the cost of frontier model output
45
+
46
+ ## Inference template
47
+
48
+ FastApply-1.5B-v1.0 is based on the Qwen2.5 Coder architecture and is fine-tuned for code editing tasks. It uses a specific prompt structure for inference:
49
+
50
+ ```
51
+ <|im_start|>user
52
+ Merge all changes from the <update> snippet into the <code> below.
53
+ - Preserve the code's structure, order, comments, and indentation exactly.
54
+ - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
55
+ - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
56
+
57
+ <code>{original_code}</code>
58
+
59
+ <update>{update_snippet}</update>
60
+
61
+ Provide the complete updated code."""
62
+ ```
63
+
64
+ The model's output is structured as:
65
+
66
+ ```
67
+ <|im_start|>assistant
68
+ <updated-code>[Full-complete updated file]</updatedcode>
69
+ ```
70
+
71
+ ## Additional Information
72
+
73
+ For more details on the Fast Apply pipeline, data generation process, and deployment instructions, please refer to the [GitHub repository](https://github.com/Kortex/FastApply).
74
+
75
+ ## How to Use
76
+
77
+ To use the model, you can load it using the Hugging Face Transformers library:
78
+
79
+ ```python
80
+ from transformers import AutoModelForCausalLM, AutoTokenizer
81
+
82
+ model = AutoModelForCausalLM.from_pretrained("Kortix/FastApply-1.5B-v1.0")
83
+ tokenizer = AutoTokenizer.from_pretrained("Kortix/FastApply-1.5B-v1.0")
84
+
85
+ # Prepare your input following the prompt structure mentioned above
86
+ input_text = """<|im_start|>user
87
+ Merge all changes from the <update> snippet into the <code> below.
88
+ - Preserve the code's structure, order, comments, and indentation exactly.
89
+ - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
90
+ - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
91
+
92
+ <code>{original_code}</code>
93
+
94
+ <update>{update_snippet}</update>
95
+
96
+ Provide the complete updated code."""
97
+
98
+ input_text = input_text.format(
99
+ original_code=original_code,
100
+ update_snippet=update_snippet,
101
+ ).strip() + tokenizer.eos_token
102
+
103
+ # Generate the response
104
+ input_ids = tokenizer.encode(input_text, return_tensors="pt")
105
+ output = model.generate(input_ids, max_length=8192)
106
+ response = tokenizer.decode(output[0])
107
 
108
+ # Extract the updated code from the response
109
+ updated_code = response.split("<updated-code>")[1].split("</updatedcode>")[0]
110
 
111
+ print(updated_code)
112
+ ```