Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes #181

Merged
merged 2 commits into from
Nov 22, 2024
Merged

fixes #181

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 src/app/new-project/sampleQue.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

80 changes: 5 additions & 75 deletions src/app/ui/pages/chat/AllTaskPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,11 @@ const AllTaskPage = () => {
}, [taskData]);
useEffect(() => {
if (AnnotationsTaskDetails?.length > 0) {
setLoading(false);
setAnnotations(AnnotationsTaskDetails);
setLoading(false);



}
}, [AnnotationsTaskDetails]);

Expand Down Expand Up @@ -432,57 +435,6 @@ console.log(annotations);
componentToRender = null;
break;
}
useEffect(() => {
if (AnnotationsTaskDetails?.length > 0) {
setLoading(false);
}
}, [AnnotationsTaskDetails]);

// const formatResponseformatResponse = (response) => {
// response = String(response);
// const output = [];
// let count = 0;

// while (response) {
// response = response.trim();
// let index = response.indexOf("```");
// if (index == -1) {
// output.push({
// type: "text",
// value: response,
// });
// break;
// } else {
// count++;
// if (count % 2 !== 0) {
// output.push({
// type: "text",
// value: response.substring(0, index),
// });
// response = response.slice(index + 3);
// } else if (count % 2 === 0) {
// let next_space = response.indexOf("\n");
// let language = response.substring(0, next_space);
// response = response.slice(next_space + 1);
// let new_index = response.indexOf("```");
// let value = response.substring(0, new_index);
// output.push({
// type: "code",
// value: value,
// language: language,
// });
// response = response.slice(new_index + 3);
// }
// }
// }
// return output;
// };

// const formatPrompt = (prompt) => {
// const lines = prompt.split("\n");
// const markdownString = lines.join(" \n");
// return markdownString;
// };

return (
<>
Expand Down Expand Up @@ -560,29 +512,7 @@ console.log(annotations);
readOnly={true}
></ReactQuill>
</div>
<Button
variant="contained"
style={{
marginLeft: "10px",
backgroundColor: "lightgrey",
color: "black",
}}
endIcon={
showGlossary ? <ArrowRightIcon /> : <ArrowDropDownIcon />
}
onClick={handleGlossaryClick}
disabled
>
Glossary
</Button>
<div
style={{
display: showGlossary ? "block" : "none",
paddingBottom: "16px",
}}
>
{/* <Glossary taskData={taskData} /> */}
</div>

</Box>
<Grid
container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const ModelInteractionEvaluation = ({

useEffect(() => {
if (forms?.length > 0 && interactions?.length > 0) {
const defaultFormId = 1;
const defaultFormId = forms[0]?.prompt_output_pair_id;
const currentForm = forms.find(
(form) => form?.prompt_output_pair_id === defaultFormId
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,18 @@ const PreferenceRanking = ({
console.log("jack", "3");

}
}, [forms, interactions]);
}, [forms, interactions, setForms, questions]);

useEffect(() => {

console.log(forms,interactions,"checking");

if (forms?.length > 0 && interactions?.length > 0) {
const defaultFormId = 1;
const defaultFormId = forms[0]?.prompt_output_pair_id;

const currentForm = forms?.find(
(form) => form?.prompt_output_pair_id == defaultFormId,
);
console.log(forms, currentForm);
console.log("forms", currentForm);

if (currentForm) {
console.log("current form: " + JSON.stringify(currentForm));
Expand Down Expand Up @@ -221,7 +222,7 @@ const PreferenceRanking = ({
}
console.log("jack", "4");

}, [forms, interactions, questions?.length]);
}, [forms, interactions, setCurrentInteraction, questions?.length]);
useEffect(() => {
if (!forms || forms.length === 0) {
setAnswered(false);
Expand Down
Loading