Skip to content

Commit

Permalink
reannotation validate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
parkchamchi committed Oct 16, 2024
1 parent cd86dc0 commit 6e28d1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/backend/gs_index/src/annotator_chatgpt.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,11 @@ class ChatgptGlossFetcher extends GlossFetcher {
console.log("res:", res);
for (let i = 0; i < tokenStrs.length; i++) {
const origTxt = tokenStrs[i];
const [retI, resValue] = Object.entries(res)[i];

const entries = Object.entries(res);
if (reannotation && i >= entries.length)
break;
const [retI, resValue] = entries[i];

if (!reannotation && i !== parseInt(retI)) {
throw new Error(`\`${retI}:\` line not found.`);
Expand Down

0 comments on commit 6e28d1b

Please sign in to comment.