🚀 FastApply-7B-v1.0
FastApply-7B-v1.0是一款专为即时代码应用设计的70亿参数模型,能够生成完整的文件编辑内容,为 SoftGen AI 提供强大支持。
Github: kortix-ai/fast-apply
数据集: Kortix/FastApply-dataset-v1.0
立即在 🖐️ Google Colab 中试用
🚀 快速开始
你可以使用Hugging Face Transformers库加载该模型:
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Kortix/FastApply-7B-v1.0")
tokenizer = AutoTokenizer.from_pretrained("Kortix/FastApply-7B-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]
✨ 主要特性
- 专为即时代码应用设计:能够生成完整的文件编辑内容,为AI代码编辑提供强大支持。
- 高吞吐量与准确性:在像Fireworks这样的快速服务提供商上部署时,能实现高吞吐量,同时保持较高的编辑准确性,速度约为150个令牌/秒。
- 广泛适用性:适用于需要快速、准确代码修改的AI代码编辑器和工具,尤其适合即时代码应用任务、完整文件编辑等。
📦 安装指南
文档未提及安装步骤,暂不提供。
💻 使用示例
基础用法
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Kortix/FastApply-7B-v1.0")
tokenizer = AutoTokenizer.from_pretrained("Kortix/FastApply-7B-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]
📚 详细文档
模型详情
基本信息
模型描述
FastApply-7B-v1.0是一个70亿参数的模型,专为即时代码应用而设计,可生成完整的文件编辑内容,为 SoftGen AI 提供支持。它是Fast Apply管道的一部分,用于数据生成和微调Qwen2.5 Coder模型。
该模型在像Fireworks这样的快速服务提供商上部署时,能实现高吞吐量,同时保持较高的编辑准确性,速度约为150个令牌/秒。
预期用途
FastApply-7B-v1.0旨在用于需要快速、准确代码修改的AI代码编辑器和工具。它特别适合以下场景:
- 即时代码应用任务
- 完整文件编辑
- 与Aider和PearAI等AI代码编辑器集成
- 本地工具,以降低前沿模型输出的成本
推理模板
FastApply-7B-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>[完整的更新文件]</updated-code>
额外信息
有关Fast Apply管道、数据生成过程和部署说明的更多详细信息,请参考 GitHub仓库。
🔧 技术细节
文档未提及技术实现细节,暂不提供。
📄 许可证
该模型使用的许可证为apache-2.0。
评估
