🚀 FastApply-1.5B-v1.0
FastApply-1.5B-v1.0は、即時コード適用のために設計された15億パラメータのモデルで、完全なファイル編集を行い、SoftGen AIをサポートします。
🚀 クイックスタート
FastApply-1.5B-v1.0を使用するには、以下のリンクを参考にしてください。
✨ 主な機能
基本情報
モデルの説明
FastApply-1.5B-v1.0は、即時コード適用のために設計された15億パラメータのモデルで、完全なファイル編集を行い、SoftGen AIをサポートします。このモデルは、Fast Applyパイプラインの一部であり、データ生成とQwen2.5 Coderモデルのファインチューニングに使用されます。
このモデルは、Fireworksのような高速なプロバイダーにデプロイされた場合、高いスループットを達成し、約340トークン/秒の速度で高い編集精度を維持します。
想定される使用方法
FastApply-1.5B-v1.0は、高速かつ正確なコード修正を必要とするAI搭載のコードエディタやツールでの使用を想定しています。特に以下の用途に適しています。
- 即時コード適用タスク
- 完全なファイル編集
- AiderやPearAIのようなAI搭載のコードエディタとの統合
- 最先端のモデル出力のコストを削減するためのローカルツール
推論テンプレート
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リポジトリを参照してください。
📦 インストール
このセクションでは、FastApply-1.5B-v1.0モデルを使用するためのコード例を示します。
基本的な使用法
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]
🔧 評価
