aashish1904 commited on
Commit
6b71633
1 Parent(s): 32593a2

Upload README.md with huggingface_hub

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