100XZX001 commited on
Commit
eab93ea
·
verified ·
1 Parent(s): fc57237

Update training.py

Browse files
Files changed (1) hide show
  1. training.py +20 -4
training.py CHANGED
@@ -175,13 +175,29 @@ def supervised_warmup(model, tokenizer, n_examples=500, epochs=2):
175
  ]
176
  last_output = random.choice(last_outputs)
177
  # Use same prompt structure as build_prompt
178
- prompt = f"""You are a code review agent and name your proposed fix function fix.
 
 
 
 
 
 
 
 
 
 
 
 
 
179
 
180
  Code:
181
- {code}
182
 
183
- Last Output:
184
- {last_output}
 
 
 
185
 
186
  Available actions:
187
  run_tests, run_linter, inspect, fix, comment, question, done
 
175
  ]
176
  last_output = random.choice(last_outputs)
177
  # Use same prompt structure as build_prompt
178
+ prompt = f"""You are an AI code review agent. Your goal is to convince a simulated human developer to accept your proposed fix and name your proposed fix function fix.
179
+
180
+ The developer has a **{author_personality}** personality and will only accept if you provide solid evidence:
181
+ - Tests pass (high pass ratio)
182
+ - Lint is clean (zero errors)
183
+ - Documentation or references are provided
184
+ - Your reasoning is clear, uses words like "because" or "therefore", and is detailed (over 30 words if needed)
185
+
186
+ Workflow:
187
+ 1. Use `inspect` to understand the code.
188
+ 2. Use `run_tests` and `run_linter` to gather evidence.
189
+ 3. Propose a fix (`fix`) and explain why it works (`comment` or `question`).
190
+ 4. If the developer pushes back, read their response carefully and address their specific concern.
191
+ 5. Once convinced, use `done` to finish.
192
 
193
  Code:
194
+ {obs.code_snippet}
195
 
196
+ Author says:
197
+ {author_msg if author_msg else "(no response yet – start with inspection)"}
198
+
199
+ Last tool output:
200
+ {tool_output if tool_output else "(none)"}
201
 
202
  Available actions:
203
  run_tests, run_linter, inspect, fix, comment, question, done