ImJimmeh commited on
Commit
ca2f965
·
verified ·
1 Parent(s): f25cc77

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +119 -0
README.md ADDED
@@ -0,0 +1,119 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ base_model: unsloth/qwen2.5-coder-1.5b-instruct-bnb-4bit
3
+ language:
4
+ - en
5
+ license: apache-2.0
6
+ tags:
7
+ - text-generation-inference
8
+ - transformers
9
+ - unsloth
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
+ [Try it now on 👉 Google Colab](https://colab.research.google.com/drive/1BNCab4oK-xBqwFQD4kCcjKc7BPKivkm1?usp=sharing)
22
+
23
+ ## Model Details
24
+
25
+ ### Basic Information
26
+
27
+ - **Developed by:** Kortix
28
+ - **License:** apache-2.0
29
+ - **Finetuned from model:** [unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit](https://huggingface.co/unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit)
30
+
31
+ ### Model Description
32
+
33
+ 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/).
34
+ It is part of the Fast Apply pipeline for data generation and fine-tuning Qwen2.5 Coder models.
35
+
36
+ The model achieves high throughput when deployed on fast providers like Fireworks while maintaining high edit accuracy, with a speed of approximately 340 tokens/second.
37
+
38
+ ## Intended Use
39
+
40
+ 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:
41
+
42
+ - Instant code application tasks
43
+ - Full file edits
44
+ - Integration with AI-powered code editors like Aider and PearAI
45
+ - Local tools to reduce the cost of frontier model output
46
+
47
+ ## Inference template
48
+
49
+ 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:
50
+
51
+ ```
52
+ <|im_start|>system
53
+ You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated.<|im_end|>
54
+ <|im_start|>user
55
+ Merge all changes from the <update> snippet into the <code> below.
56
+ - Preserve the code's structure, order, comments, and indentation exactly.
57
+ - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
58
+ - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
59
+
60
+ <code>{original_code}</code>
61
+
62
+ <update>{update_snippet}</update>
63
+
64
+ Provide the complete updated code.<|im_end|>
65
+ <|im_start|>assistant
66
+ ```
67
+
68
+ The model's output is structured as:
69
+
70
+ ```
71
+ <updated-code>[Full-complete updated file]</updated-code>
72
+ ```
73
+
74
+ ## Additional Information
75
+
76
+ 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).
77
+
78
+ ## How to Use
79
+
80
+ To use the model, you can load it using the Hugging Face Transformers library:
81
+
82
+ ```python
83
+ from transformers import AutoModelForCausalLM, AutoTokenizer
84
+
85
+ model = AutoModelForCausalLM.from_pretrained("Kortix/FastApply-1.5B-v1.0", device_map="auto")
86
+ tokenizer = AutoTokenizer.from_pretrained("Kortix/FastApply-1.5B-v1.0")
87
+
88
+ # Prepare your input following the prompt structure mentioned above
89
+ input_text = """<|im_start|>system
90
+ You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated.<|im_end|>
91
+ <|im_start|>user
92
+ Merge all changes from the <update> snippet into the <code> below.
93
+ - Preserve the code's structure, order, comments, and indentation exactly.
94
+ - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
95
+ - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
96
+
97
+ <code>{original_code}</code>
98
+
99
+ <update>{update_snippet}</update>
100
+
101
+ Provide the complete updated code.<|im_end|>
102
+ <|im_start|>assistant
103
+ """
104
+
105
+ input_text = input_text.format(
106
+ original_code=original_code,
107
+ update_snippet=update_snippet,
108
+ ).strip()
109
+
110
+ # Generate the response
111
+ input_ids = tokenizer.encode(input_text, return_tensors="pt")
112
+ output = model.generate(input_ids, max_length=8192,)
113
+
114
+ response = tokenizer.decode(output[0][len(input_ids[0]):])
115
+ print(response)
116
+
117
+ # Extract the updated code from the response
118
+ updated_code = response.split("<updated-code>")[1].split("</updated-code>")[0]
119
+ ```