Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion web-ui/src/ZeroStyleApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function getZeroStyleParams(): {
assistantNoiseTopK,
};
}
// TODO: inference_human timestep is currently incorrect

function ZeroStyleApp() {
const [problem, setProblem] = useState<Problem | null>(null);
const [initCode, setInitCode] = useState("");
Expand Down
10 changes: 7 additions & 3 deletions web-ui/src/app/api/episode-data/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,18 @@ export async function GET(request: NextRequest) {
}

// Get the specific timestep line
if (timestepNum > lines.length) {
// File structure: Line 0 = Header, Line 1 = timestep 0, Line 2 = timestep 1, etc.
// So timestep N is at line index N+1
const lineIndex = timestepNum + 1;

if (lineIndex >= lines.length) {
return NextResponse.json(
{ error: `Timestep ${timestepNum} exceeds available lines (${lines.length})` },
{ error: `Timestep ${timestepNum} exceeds available data (max timestep: ${lines.length - 2})` },
{ status: 400 }
);
}

const timestepLine = lines[timestepNum]; // Timestep[i] is on line i+1
const timestepLine = lines[lineIndex];
const timestepData = JSON.parse(timestepLine);

const text = timestepData.text || '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ export class StateServiceHumanSimulator implements HumanSimulator {

setInitialTimestep(timestep: number): void {
console.log("🎯 Setting initial timestep to:", timestep);
this.timestep = timestep;
console.log("🎯 Timestep after setting:", this.timestep);
// The provided timestep represents the last completed state in the attribution log.
// The next inference should start from timestep + 1.
this.timestep = timestep + 1;
console.log("🎯 Next inference will start at timestep:", this.timestep);
}

getStats(): SimulationStats {
Expand Down