🚀 FastApply-1.5B-v1.0
FastApply-1.5B-v1.0是一個專為即時代碼應用而設計的15億參數模型,能夠生成完整的文件編輯內容,為 SoftGen AI 提供強大支持。它是Fast Apply管道的一部分,用於數據生成和微調Qwen2.5 Coder模型。
Github: kortix-ai/fast-apply
數據集: Kortix/FastApply-dataset-v1.0
立即在👉 Google Colab中試用
📚 詳細文檔
基本信息
模型描述
FastApply-1.5B-v1.0是一個15億參數的模型,專為即時代碼應用而設計,能夠生成完整的文件編輯內容,為 SoftGen AI 提供支持。它是Fast Apply管道的一部分,用於數據生成和微調Qwen2.5 Coder模型。
該模型在部署到Fireworks等快速服務提供商時,能夠實現高吞吐量,同時保持較高的編輯準確率,速度約為340個令牌/秒。
🎯 預期用途
FastApply-1.5B-v1.0旨在用於人工智能驅動的代碼編輯器和需要快速、準確代碼修改的工具。它特別適用於:
- 即時代碼應用任務
- 完整文件編輯
- 與Aider和PearAI等人工智能驅動的代碼編輯器集成
- 本地工具,以降低前沿模型輸出的成本
💻 推理模板
FastApply-1.5B-v1.0基於Qwen2.5 Coder架構,並針對代碼編輯任務進行了微調。它使用特定的提示結構進行推理:
<|im_start|>system
You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated.<|im_end|>
<|im_start|>user
Merge all changes from the <update> snippet into the <code> below.
- Preserve the code's structure, order, comments, and indentation exactly.
- Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
- Do not include any additional text, explanations, placeholders, ellipses, or code fences.
<code>{original_code}</code>
<update>{update_snippet}</update>
Provide the complete updated code.<|im_end|>
<|im_start|>assistant
模型的輸出結構如下:
<updated-code>[Full-complete updated file]</updated-code>
📖 額外信息
有關Fast Apply管道、數據生成過程和部署說明的更多詳細信息,請參考 GitHub倉庫。
💻 使用示例
基礎用法
要使用該模型,您可以使用Hugging Face Transformers庫加載它:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Kortix/FastApply-1.5B-v1.0", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("Kortix/FastApply-1.5B-v1.0")
input_text = """<|im_start|>system
You are a coding assistant that helps merge code updates, ensuring every modification is fully integrated.<|im_end|>
<|im_start|>user
Merge all changes from the <update> snippet into the <code> below.
- Preserve the code's structure, order, comments, and indentation exactly.
- Output only the updated code, enclosed within <updated-code> and </updated-code> tags.
- Do not include any additional text, explanations, placeholders, ellipses, or code fences.
<code>{original_code}</code>
<update>{update_snippet}</update>
Provide the complete updated code.<|im_end|>
<|im_start|>assistant
"""
input_text = input_text.format(
original_code=original_code,
update_snippet=update_snippet,
).strip()
input_ids = tokenizer.encode(input_text, return_tensors="pt")
output = model.generate(input_ids, max_length=8192,)
response = tokenizer.decode(output[0][len(input_ids[0]):])
print(response)
updated_code = response.split("<updated-code>")[1].split("</updated-code>")[0]
📊 評估
