-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
736 additions
and
233 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
window.BENCHMARK_OUTPUT_BASE_URL = | ||
"https://storage.googleapis.com/crfm-helm-public/"; | ||
window.SUITE = "v0.2.4"; | ||
window.RELEASE = "v0.3.0"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useState } from "react"; | ||
import Link from "./Link"; | ||
|
||
export default function Alert() { | ||
const [visible, setVisible] = useState(true); | ||
|
||
const handleClose = () => { | ||
setVisible(false); | ||
}; | ||
|
||
return ( | ||
visible && ( | ||
<div | ||
className="fixed bottom-5 right-5 bg-gray-100 border border-gray-400 text-gray-700 px-4 py-3 rounded z-50" | ||
role="alert" | ||
> | ||
<div className="px-3"> | ||
<strong className="font-bold"> | ||
Welcome to the new results view, | ||
</strong> | ||
<span className="block sm:inline"> for the old view, </span> | ||
<Link to={"/groups"}> | ||
<a className="underline text-gray-700 mr-2">click here</a> | ||
</Link> | ||
</div> | ||
<span | ||
className="absolute top-1 bottom-1 right-0 px-4 py-3" | ||
onClick={handleClose} | ||
> | ||
<img | ||
src="https://www.svgrepo.com/show/12848/x-symbol.svg" | ||
alt="Close" | ||
className="h-3 w-3" | ||
/> | ||
</span> | ||
</div> | ||
) | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import helmHero from "@/assets/helmhero.png"; | ||
import { Link } from "react-router-dom"; | ||
|
||
export default function Hero() { | ||
return ( | ||
<div className="flex px-6 py-14"> | ||
{/* Left side content */} | ||
<div className="flex-1 p-4 flex flex-col justify-center"> | ||
{" "} | ||
{/* Added flex and justify-center */} | ||
<h1 className="text-4xl mb-4 mx-4"> | ||
{" "} | ||
{/* Added mx-4 for horizontal margin */} | ||
HELM is{" "} | ||
<strong> | ||
{" "} | ||
a transparent benchmarking system for language models{" "} | ||
</strong> | ||
, providing standardized evaluations with multiple metrics and open | ||
access. | ||
</h1> | ||
<div className="flex justify-end w-1/4"> | ||
<Link to="leaderboard"> | ||
<button className="px-6 btn btn-grey rounded-md"> | ||
<body>Visit Leaderboard</body> | ||
</button> | ||
</Link> | ||
</div> | ||
</div> | ||
|
||
{/* Right side image */} | ||
<div className="w-1/3 mx-4"> | ||
{" "} | ||
{/* Added mx-4 for horizontal margin */} | ||
<img | ||
src={helmHero} | ||
alt="HELM Hero" | ||
className="object-cover w-full h-full" | ||
/> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
import { useEffect, useState } from "react"; | ||
import { ChevronUpDownIcon } from "@heroicons/react/24/solid"; | ||
import type GroupsTable from "@/types/GroupsTable"; | ||
import RowValue from "@/components/RowValue"; | ||
|
||
interface Props { | ||
groupsTables: GroupsTable[]; | ||
activeGroup: number; | ||
ignoreHref?: boolean; | ||
sortable?: boolean; | ||
sortFirstMetric?: boolean; | ||
} | ||
|
||
export default function LeaderboardTables({ | ||
groupsTables, | ||
activeGroup, | ||
ignoreHref = false, | ||
sortable = true, | ||
sortFirstMetric = true, | ||
}: Props) { | ||
const [activeSortColumn, setActiveSortColumn] = useState<number | undefined>( | ||
sortFirstMetric ? 1 : undefined, | ||
); | ||
const [activeGroupsTable, setActiveGroupsTable] = useState<GroupsTable>({ | ||
...groupsTables[activeGroup], | ||
}); | ||
const [sortDirection, setSortDirection] = useState<number>(1); | ||
|
||
useEffect(() => { | ||
setActiveGroupsTable({ ...groupsTables[activeGroup] }); | ||
}, [activeGroup, groupsTables]); | ||
|
||
const handleSort = (columnIndex: number) => { | ||
let sort = sortDirection; | ||
if (activeSortColumn === columnIndex) { | ||
sort = sort * -1; | ||
} else { | ||
sort = 1; | ||
} | ||
setActiveSortColumn(columnIndex); | ||
setSortDirection(sort); | ||
|
||
setActiveGroupsTable((prev) => { | ||
const group = { ...prev }; | ||
group.rows.sort((a, b) => { | ||
const av = a[columnIndex]?.value; | ||
const bv = b[columnIndex]?.value; | ||
if (av !== undefined && bv === undefined) { | ||
return -1; | ||
} | ||
if (bv !== undefined && av === undefined) { | ||
return 1; | ||
} | ||
if (typeof av === "number" && typeof bv === "number") { | ||
return (av - bv) * sort; | ||
} | ||
if (typeof av === "string" && typeof bv === "string") { | ||
if (sort === 1) { | ||
return av.localeCompare(bv); | ||
} | ||
return bv.localeCompare(av); | ||
} | ||
|
||
return 0; | ||
}); | ||
|
||
return group; | ||
}); | ||
}; | ||
useEffect(() => { | ||
if (sortFirstMetric && activeSortColumn) { | ||
handleSort(activeSortColumn); | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [sortFirstMetric, activeSortColumn]); | ||
|
||
return ( | ||
<div className="rounded-lg overflow-hidden shadow-md bg-white p-4"> | ||
<div className="overflow-x-auto"> | ||
<table className="table w-full px-4"> | ||
<thead> | ||
<tr> | ||
{activeGroupsTable.header.map((headerValue, idx) => ( | ||
<th | ||
key={`${activeGroup}-${idx}`} | ||
className={`${ | ||
idx === activeSortColumn ? "bg-gray-100" : "" | ||
} whitespace-nowrap px-4`} | ||
> | ||
<div className="flex gap-2 items-center"> | ||
<span>{headerValue.value}</span> | ||
{sortable ? ( | ||
<button className="link" onClick={() => handleSort(idx)}> | ||
<ChevronUpDownIcon className="w-6 h-6" /> | ||
</button> | ||
) : null} | ||
</div> | ||
</th> | ||
))} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{activeGroupsTable.rows.map((row, idx) => ( | ||
<tr | ||
key={`${activeGroup}-${idx}`} | ||
className={`${idx % 2 === 0 ? "bg-gray-50" : ""}`} | ||
> | ||
{" "} | ||
{/* Added alternating row highlighting */} | ||
{row.map((rowValue, cellIdx) => ( | ||
<td | ||
key={`${activeGroup}-${cellIdx}`} | ||
className={`${cellIdx === 0 ? "text-lg" : ""}`} | ||
> | ||
<RowValue | ||
ignoreHref={ignoreHref && cellIdx === 0} | ||
value={rowValue} | ||
/> | ||
</td> | ||
))} | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.