reissbaker commited on
Commit
bb0542c
·
verified ·
1 Parent(s): e1b8ef7

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +43 -3
README.md CHANGED
@@ -1,3 +1,43 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+
5
+ [Run `diff-apply` on
6
+ Synthetic!](https://synthetic.new/hf/syntheticlab/diff-apply)
7
+
8
+ `diff-apply` is a small, fast model to apply search-and-replace style diffs to
9
+ code. Many coding agents use search-and-replace as the default first-line edit
10
+ format; however, for larger diffs, it's common for even fairly good coding
11
+ models to produce slightly inaccurate search strings, i.e. with spacing
12
+ slightly off or with other minor differences.
13
+
14
+ Typically, coding agents will do the following to handle those errors:
15
+
16
+ 1. Hardcode heuristics to attempt to apply certain classes of incorrect diffs
17
+ 2. If that fails, retry calling the original model, which can be expensive and
18
+ slow, and also can confuse the original model as to what the current file
19
+ state is.
20
+
21
+ `diff-apply` is trained to fix those diffs, allowing coding agents to typically
22
+ skip (expensive, slow, model-confusing) retries, much more robustly than
23
+ hardcoded heuristics. It's a Llama 3.1 8b LoRA, which means you can run it
24
+ cheaply on inference providers like
25
+ [Synthetic](https://synthetic.new/hf/syntheticlab/diff-apply).
26
+
27
+ The model expects prompts in the following format:
28
+
29
+ ```
30
+ This edit is invalid; please fix it. The search string does not match perfectly with the file contents.
31
+ Respond only with JSON, and only with the edit JSON, not the original file.
32
+ If the edit is ambiguous, respond with null.
33
+ {
34
+ "file": "the-underlying-file",
35
+ "edit": {
36
+ "type": "diff",
37
+ "search": "the-search-string",
38
+ "replace": "the-replace-string",
39
+ }
40
+ }
41
+ ```
42
+
43
+ It will respond with the fixed edit in JSON.