Fix initial Ranking

This commit is contained in:
AbdBarho
2023-01-14 08:03:19 +01:00
parent b543b4b545
commit 22bc9c2730
@@ -22,13 +22,9 @@ export const EvaluateTask = ({
}
useEffect(() => {
const conversationMsgs = task.conversation ? task.conversation.messages : [];
const defaultRanking = conversationMsgs.map((message, index) => index);
onReplyChanged({
content: { ranking: defaultRanking },
state: "DEFAULT",
});
}, [task.conversation, onReplyChanged]);
const ranking = (task.replies ?? task.prompts).map((_, idx) => idx);
onReplyChanged({ content: { ranking }, state: "DEFAULT" });
}, [task, onReplyChanged]);
const onRank = (newRanking: number[]) => {
onReplyChanged({ content: { ranking: newRanking }, state: "VALID" });