aashish1904 commited on
Commit
3796645
·
verified ·
1 Parent(s): de87712

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +136 -0
README.md ADDED
@@ -0,0 +1,136 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ ---
3
+
4
+ base_model: unsloth/qwen2.5-coder-1.5b-instruct-bnb-4bit
5
+ language:
6
+ - en
7
+ license: apache-2.0
8
+ tags:
9
+ - text-generation-inference
10
+ - transformers
11
+ - unsloth
12
+ - qwen2
13
+ - trl
14
+ - sft
15
+ - fast-apply
16
+ - instant-apply
17
+
18
+ ---
19
+
20
+ [![QuantFactory Banner](https://lh7-rt.googleusercontent.com/docsz/AD_4nXeiuCm7c8lEwEJuRey9kiVZsRn2W-b4pWlu3-X534V3YmVuVc2ZL-NXg2RkzSOOS2JXGHutDuyyNAUtdJI65jGTo8jT9Y99tMi4H4MqL44Uc5QKG77B0d6-JfIkZHFaUA71-RtjyYZWVIhqsNZcx8-OMaA?key=xt3VSDoCbmTY7o-cwwOFwQ)](https://hf.co/QuantFactory)
21
+
22
+
23
+ # QuantFactory/FastApply-1.5B-v1.0-GGUF
24
+ This is quantized version of [Kortix/FastApply-1.5B-v1.0](https://huggingface.co/Kortix/FastApply-1.5B-v1.0) created using llama.cpp
25
+
26
+ # Original Model Card
27
+
28
+
29
+ # FastApply-1.5B-v1.0
30
+
31
+ [Github: kortix-ai/fast-apply](https://github.com/kortix-ai/fast-apply)
32
+ [Dataset: Kortix/FastApply-dataset-v1.0](https://huggingface.co/datasets/Kortix/FastApply-dataset-v1.0)
33
+ [Try it now on 👉 Google Colab](https://colab.research.google.com/drive/1BNCab4oK-xBqwFQD4kCcjKc7BPKivkm1?usp=sharing)
34
+
35
+ ## Model Details
36
+
37
+ ### Basic Information
38
+
39
+ - **Developed by:** Kortix
40
+ - **License:** apache-2.0
41
+ - **Finetuned from model:** [unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit](https://huggingface.co/unsloth/Qwen2.5-Coder-1.5B-Instruct-bnb-4bit)
42
+
43
+ ### Model Description
44
+
45
+ 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/).
46
+ It is part of the Fast Apply pipeline for data generation and fine-tuning Qwen2.5 Coder models.
47
+
48
+ 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.
49
+
50
+ ## Intended Use
51
+
52
+ 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:
53
+
54
+ - Instant code application tasks
55
+ - Full file edits
56
+ - Integration with AI-powered code editors like Aider and PearAI
57
+ - Local tools to reduce the cost of frontier model output
58
+
59
+ ## Inference template
60
+
61
+ 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:
62
+
63
+ ```
64
+ <|im_start|>system
65
+ You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated.<|im_end|>
66
+ <|im_start|>user
67
+ Merge all changes from the <update> snippet into the <code> below.
68
+ - Preserve the code's structure, order, comments, and indentation exactly.
69
+ - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
70
+ - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
71
+
72
+ <code>{original_code}</code>
73
+
74
+ <update>{update_snippet}</update>
75
+
76
+ Provide the complete updated code.<|im_end|>
77
+ <|im_start|>assistant
78
+ ```
79
+
80
+ The model's output is structured as:
81
+
82
+ ```
83
+ <updated-code>[Full-complete updated file]</updated-code>
84
+ ```
85
+
86
+ ## Additional Information
87
+
88
+ For more details on the Fast Apply pipeline, data generation process, and deployment instructions, please refer to the [GitHub repository](https://github.com/kortix-ai/fast-apply).
89
+
90
+ ## How to Use
91
+
92
+ To use the model, you can load it using the Hugging Face Transformers library:
93
+
94
+ ```python
95
+ from transformers import AutoModelForCausalLM, AutoTokenizer
96
+
97
+ model = AutoModelForCausalLM.from_pretrained("Kortix/FastApply-1.5B-v1.0", device_map="auto")
98
+ tokenizer = AutoTokenizer.from_pretrained("Kortix/FastApply-1.5B-v1.0")
99
+
100
+ # Prepare your input following the prompt structure mentioned above
101
+ input_text = """<|im_start|>system
102
+ You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated.<|im_end|>
103
+ <|im_start|>user
104
+ Merge all changes from the <update> snippet into the <code> below.
105
+ - Preserve the code's structure, order, comments, and indentation exactly.
106
+ - Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
107
+ - Do not include any additional text, explanations, placeholders, ellipses, or code fences.
108
+
109
+ <code>{original_code}</code>
110
+
111
+ <update>{update_snippet}</update>
112
+
113
+ Provide the complete updated code.<|im_end|>
114
+ <|im_start|>assistant
115
+ """
116
+
117
+ input_text = input_text.format(
118
+ original_code=original_code,
119
+ update_snippet=update_snippet,
120
+ ).strip()
121
+
122
+ # Generate the response
123
+ input_ids = tokenizer.encode(input_text, return_tensors="pt")
124
+ output = model.generate(input_ids, max_length=8192,)
125
+
126
+ response = tokenizer.decode(output[0][len(input_ids[0]):])
127
+ print(response)
128
+
129
+ # Extract the updated code from the response
130
+ updated_code = response.split("<updated-code>")[1].split("</updated-code>")[0]
131
+ ```
132
+
133
+ ## Evaluation:
134
+
135
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/650d7ecb23e8028a8970a203/_E6WVzuVABKB58QMx6c1c.png)
136
+