Skip to content

Commit

Permalink
deplot
Browse files Browse the repository at this point in the history
  • Loading branch information
Naman-ntc committed Mar 13, 2024
1 parent c37e38a commit 98e2bc6
Show file tree
Hide file tree
Showing 12 changed files with 79 additions and 31 deletions.
12 changes: 6 additions & 6 deletions build/asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"files": {
"main.css": "./static/css/main.42311975.css",
"main.js": "./static/js/main.7e4b1397.js",
"main.css": "./static/css/main.06cfd650.css",
"main.js": "./static/js/main.5866ab05.js",
"index.html": "./index.html",
"main.42311975.css.map": "./static/css/main.42311975.css.map",
"main.7e4b1397.js.map": "./static/js/main.7e4b1397.js.map"
"main.06cfd650.css.map": "./static/css/main.06cfd650.css.map",
"main.5866ab05.js.map": "./static/js/main.5866ab05.js.map"
},
"entrypoints": [
"static/css/main.42311975.css",
"static/js/main.7e4b1397.js"
"static/css/main.06cfd650.css",
"static/js/main.5866ab05.js"
]
}
2 changes: 1 addition & 1 deletion build/leaderboard.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><title>LiveCodeBench Leaderboard</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="LiveCodeBench Leaderboard"/><link rel="stylesheet" href="bootstrap.min.css"/><link rel="stylesheet" href="./css/bulma.min.css"/><link rel="stylesheet" href="./css/bulma-carousel.min.css"/><link rel="stylesheet" href="./css/bulma-slider.min.css"/><link rel="stylesheet" href="./css/fontawesome.all.min.css"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css"/><link rel="stylesheet" href="./css/index.css"/><link rel="icon" href="./images/favicon.svg"/><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script><script defer="defer" src="./js/fontawesome.all.min.js"></script><script src="./js/bulma-carousel.min.js"></script><script src="./js/bulma-slider.min.js"></script><script src="./js/index.js"></script><script defer="defer" src="./static/js/main.7e4b1397.js"></script><link href="./static/css/main.42311975.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><title>LiveCodeBench Leaderboard</title><meta charset="UTF-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="LiveCodeBench Leaderboard"/><link rel="stylesheet" href="bootstrap.min.css"/><link rel="stylesheet" href="./css/bulma.min.css"/><link rel="stylesheet" href="./css/bulma-carousel.min.css"/><link rel="stylesheet" href="./css/bulma-slider.min.css"/><link rel="stylesheet" href="./css/fontawesome.all.min.css"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/jpswalsh/academicons@1/css/academicons.min.css"/><link rel="stylesheet" href="./css/index.css"/><link rel="icon" href="./images/favicon.svg"/><script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script><script defer="defer" src="./js/fontawesome.all.min.js"></script><script src="./js/bulma-carousel.min.js"></script><script src="./js/bulma-slider.min.js"></script><script src="./js/index.js"></script><script defer="defer" src="./static/js/main.5866ab05.js"></script><link href="./static/css/main.06cfd650.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions build/static/css/main.06cfd650.css.map

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion build/static/css/main.42311975.css.map

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

40 changes: 32 additions & 8 deletions src/LeaderboardComp.css
Original file line number Diff line number Diff line change
@@ -1,17 +1,41 @@
agGridMaxWidth {
max-width: 1200px;
width: 100% !important;
/* Adjust this value based on your preference */
margin: auto;
/* This centers the grid horizontally */
}

.ag-root-wrapper {
width: 100% !important;
/* max-width: 750px; */
margin: auto;
}

.ag-theme-quartz {
width: 100% !important;
margin: auto;
}


.ag-theme-quartz .ag-cell {
font-size: 17px !important;
/* align-items: center; */
/* width: 100% !important;
margin: auto; */
}

.ag-theme-quartz .ag-header-cell-label {
font-size: 19px !important;
align-items: center;
/* align-items: center; */
/* width: 100% !important;
margin: auto; */
}

#flexGridWrapper {
width: 100% !important;
margin: auto;
/* max-width: 760px; */

}

.MuiSlider-markLabel {
Expand Down Expand Up @@ -41,16 +65,16 @@

.ag-theme-quartz .ag-cell {
font-size: 12px !important;
align-items: center;
width: 100% !important;
margin: auto;
/* align-items: center; */
/* width: 100% !important;
margin: auto; */
}

.ag-theme-quartz .ag-header-cell-label {
font-size: 14px !important;
align-items: center;
width: 100% !important;
margin: auto;
/* align-items: center; */
/* width: 100% !important;
margin: auto; */
}

#flexGridWrapper {
Expand Down
25 changes: 20 additions & 5 deletions src/LeaderboardComp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ const Leaderboard = React.memo(function LeaderboardComponent(props: any) {
const { performances, models, date_marks } = args;


const [isMobileCompressed, setIsMobileCompressed] = useState(window.innerWidth < 768);

// const [data, setData] = useState(args);

// console.log(props)
Expand All @@ -54,7 +56,7 @@ const Leaderboard = React.memo(function LeaderboardComponent(props: any) {
const [dateMarks, setDateMarks] = React.useState(() => getDateMarksFromTimestamps(date_marks));

useEffect(() => {
console.log('Component re-rendered due to changes in date_marks:', date_marks);
// console.log('Component re-rendered due to changes in date_marks:', date_marks);
setDateMarks(getDateMarksFromTimestamps(date_marks));
}, [date_marks]);

Expand Down Expand Up @@ -122,7 +124,20 @@ const Leaderboard = React.memo(function LeaderboardComponent(props: any) {
);
}, [performances, models, dateStartAndEnd]);

if (isMobileCompressed) {
// remove columns from leaderboard
// remove Easy-Pass@1, Medium-Pass@1, Hard-Pass@1

// will delete throw error if column not found

leaderboard.forEach((row: any) => {
delete row["Easy-Pass@1"];
delete row["Medium-Pass@1"];
delete row["Hard-Pass@1"];
delete row["Pass@1 (no COT)"];
});

}
// console.log(leaderboard)


Expand Down Expand Up @@ -159,7 +174,7 @@ const Leaderboard = React.memo(function LeaderboardComponent(props: any) {
const [rowData, setRowData] = useState(leaderboard)

useEffect(() => {
console.log('Component re-rendered due to changes in leaderboard:', leaderboard);
// console.log('Component re-rendered due to changes in leaderboard:', leaderboard);
setRowData(leaderboard);
}, [leaderboard]);

Expand All @@ -168,7 +183,7 @@ const Leaderboard = React.memo(function LeaderboardComponent(props: any) {
)

useEffect(() => {
console.log('Component re-rendered due to changes in column:', columnNames, modelsDict);
// console.log('Component re-rendered due to changes in column:', columnNames, modelsDict);
setColumnDefs(getColumnDefs(columnNames, modelsDict));
}, [columnNames, modelsDict]);

Expand All @@ -190,11 +205,11 @@ const Leaderboard = React.memo(function LeaderboardComponent(props: any) {

const gridStyle = useMemo(
() => ({
// height: "1250px",
height: 42 * rowData.length + "px",
"--ag-font-family": FONT_FAMILY,
// minWidth: "760px",
// maxWidth: "100%",
"--ag-font-family": FONT_FAMILY,
// height: "1250px",
}),
[rowData]
)
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const LeaderboardTabs = () => {

// Function to render the leaderboard based on the selected tab
const renderLeaderboard = () => {
console.log(activeTab);
// console.log(activeTab);
switch (activeTab) {
case 'tab1':
return <Leaderboard theme={{ base: "light" }} args={mockDataGen} />;
Expand Down
15 changes: 12 additions & 3 deletions src/leaderboardLib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function get_pass_at_1(
mean(results.map((result) => result["Pass@1-COT"]))
)

console.log("COT PASS: ", cot_pass, cot_pass != undefined, cot_pass != null, cot_pass.toString() != "NaN")
// console.log("COT PASS: ", cot_pass, cot_pass != undefined, cot_pass != null, cot_pass.toString() != "NaN")

return {
average_pass,
Expand Down Expand Up @@ -149,7 +149,7 @@ function getLeaderboard(
"Release Date: " + new Date(model.release_date).toLocaleDateString(),
Contaminated: model.release_date >= start,
"Pass@1": cot_pass,
"Pass@1 (no CoT)": exec_pass,
"Pass@1 (no COT)": exec_pass,
}
return output
}
Expand Down Expand Up @@ -272,7 +272,7 @@ function getColumnDefs(columnNames: Array<string>, modelsDict: any) {
`,
sort: "desc",
}
case "Pass@1-CoT":
case "Pass@1-COT":
return {
field: column_name,
headerTooltip: `
Expand All @@ -281,6 +281,15 @@ function getColumnDefs(columnNames: Array<string>, modelsDict: any) {
sort: "desc",
}

case "Pass@1 (no COT)":
return {
field: column_name,
headerTooltip: `
Pass@1 is probability of passing a given problem in one attempt with CoT.
`,
sort: "desc",
}

case "Easy-Pass@1":
return {
field: column_name,
Expand Down

0 comments on commit 98e2bc6

Please sign in to comment.