Spaces:
Running
Running
Mark Duppenthaler
commited on
Commit
·
3a8329c
1
Parent(s):
2ebc2c3
message size and alias updates
Browse files- frontend/dist/assets/{index-DNwK_9E1.js → index-DiLkGNtv.js} +0 -0
- frontend/dist/index.html +1 -1
- frontend/src/Descriptions.ts +8 -0
- frontend/src/components/DatasetSelector.tsx +1 -1
- frontend/src/components/Examples.tsx +2 -1
- frontend/src/components/LeaderboardChart.tsx +10 -3
- frontend/src/components/ModelFilter.tsx +2 -1
- frontend/src/components/ModelInfoIcon.tsx +2 -0
frontend/dist/assets/{index-DNwK_9E1.js → index-DiLkGNtv.js}
RENAMED
The diff for this file is too large to render.
See raw diff
|
|
frontend/dist/index.html
CHANGED
@@ -5,7 +5,7 @@
|
|
5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7 |
<title>🥇 Omni Seal Bench Watermarking Leaderboard</title>
|
8 |
-
<script type="module" crossorigin src="/assets/index-
|
9 |
<link rel="stylesheet" crossorigin href="/assets/index-stFRue7K.css">
|
10 |
</head>
|
11 |
<body>
|
|
|
5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
7 |
<title>🥇 Omni Seal Bench Watermarking Leaderboard</title>
|
8 |
+
<script type="module" crossorigin src="/assets/index-DiLkGNtv.js"></script>
|
9 |
<link rel="stylesheet" crossorigin href="/assets/index-stFRue7K.css">
|
10 |
</head>
|
11 |
<body>
|
frontend/src/Descriptions.ts
CHANGED
@@ -43,6 +43,10 @@ class Descriptions {
|
|
43 |
return this.descriptions[name]?.link
|
44 |
}
|
45 |
|
|
|
|
|
|
|
|
|
46 |
getModelDescription(name: string): string | undefined {
|
47 |
return this.modelDescriptions[name]?.description
|
48 |
}
|
@@ -59,6 +63,10 @@ class Descriptions {
|
|
59 |
return this.modelDescriptions[name]?.github_link
|
60 |
}
|
61 |
|
|
|
|
|
|
|
|
|
62 |
// Metric description methods
|
63 |
getMetricDescription(name: string): string | undefined {
|
64 |
return this.metricDescriptions[name]?.description
|
|
|
43 |
return this.descriptions[name]?.link
|
44 |
}
|
45 |
|
46 |
+
getModelAlias(name: string): string | undefined {
|
47 |
+
return this.modelDescriptions[name]?.alias
|
48 |
+
}
|
49 |
+
|
50 |
getModelDescription(name: string): string | undefined {
|
51 |
return this.modelDescriptions[name]?.description
|
52 |
}
|
|
|
63 |
return this.modelDescriptions[name]?.github_link
|
64 |
}
|
65 |
|
66 |
+
getModelMessageSize(name: string): number | undefined {
|
67 |
+
return this.modelDescriptions[name]?.message_size
|
68 |
+
}
|
69 |
+
|
70 |
// Metric description methods
|
71 |
getMetricDescription(name: string): string | undefined {
|
72 |
return this.metricDescriptions[name]?.description
|
frontend/src/components/DatasetSelector.tsx
CHANGED
@@ -26,7 +26,7 @@ const DatasetSelector: React.FC<DatasetSelectorProps> = ({
|
|
26 |
checked={selectedDatasetName === datasetName}
|
27 |
onChange={() => onDatasetNameChange(datasetName)}
|
28 |
/>
|
29 |
-
<span className="text-sm">{datasetName}</span>
|
30 |
<DatasetInfoIcon datasetName={datasetName} />
|
31 |
</label>
|
32 |
))}
|
|
|
26 |
checked={selectedDatasetName === datasetName}
|
27 |
onChange={() => onDatasetNameChange(datasetName)}
|
28 |
/>
|
29 |
+
<span className="text-sm ml-2">{datasetName}</span>
|
30 |
<DatasetInfoIcon datasetName={datasetName} />
|
31 |
</label>
|
32 |
))}
|
frontend/src/components/Examples.tsx
CHANGED
@@ -111,6 +111,7 @@ const Examples = ({ fileType }: ExamplesProps) => {
|
|
111 |
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-1 max-h-48 overflow-y-auto pr-2">
|
112 |
{Object.keys(examples).map((model) => {
|
113 |
const fullName = descriptions.current.getModelFullName(model) || model
|
|
|
114 |
return (
|
115 |
<div key={model} className="flex items-center gap-2 text-sm relative group">
|
116 |
<label className="flex items-center gap-2 flex-grow">
|
@@ -123,7 +124,7 @@ const Examples = ({ fileType }: ExamplesProps) => {
|
|
123 |
/>
|
124 |
<div className="flex items-center">
|
125 |
<span className="truncate" title={fullName}>
|
126 |
-
{
|
127 |
</span>
|
128 |
<ModelInfoIcon modelName={model} />
|
129 |
</div>
|
|
|
111 |
<div className="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-1 max-h-48 overflow-y-auto pr-2">
|
112 |
{Object.keys(examples).map((model) => {
|
113 |
const fullName = descriptions.current.getModelFullName(model) || model
|
114 |
+
const modelAlias = descriptions.current.getModelAlias(model) || model
|
115 |
return (
|
116 |
<div key={model} className="flex items-center gap-2 text-sm relative group">
|
117 |
<label className="flex items-center gap-2 flex-grow">
|
|
|
124 |
/>
|
125 |
<div className="flex items-center">
|
126 |
<span className="truncate" title={fullName}>
|
127 |
+
{modelAlias}
|
128 |
</span>
|
129 |
<ModelInfoIcon modelName={model} />
|
130 |
</div>
|
frontend/src/components/LeaderboardChart.tsx
CHANGED
@@ -14,6 +14,7 @@ import API from '../API'
|
|
14 |
import LoadingSpinner from './LoadingSpinner'
|
15 |
import { ContentType, TooltipProps } from 'recharts/types/component/Tooltip'
|
16 |
import { NameType, ValueType } from 'recharts/types/component/DefaultTooltipContent'
|
|
|
17 |
|
18 |
interface LeaderboardChartProps {
|
19 |
dataset: string
|
@@ -82,6 +83,10 @@ const AttackSelector = ({
|
|
82 |
)
|
83 |
}
|
84 |
|
|
|
|
|
|
|
|
|
85 |
const CustomTooltip = (
|
86 |
props: TooltipProps<ValueType, NameType> & {
|
87 |
dataset: string
|
@@ -115,9 +120,11 @@ const CustomTooltip = (
|
|
115 |
</div>
|
116 |
{payload.map((entry: any, i: number) => {
|
117 |
const model = entry.name
|
|
|
|
|
118 |
const handleClick = () => {
|
119 |
navigate(
|
120 |
-
`${route}?model=${encodeURIComponent(
|
121 |
)
|
122 |
}
|
123 |
|
@@ -285,11 +292,11 @@ const LeaderboardChart = ({ dataset, selectedModels, datasetType }: LeaderboardC
|
|
285 |
return [...models].map((model, index) => {
|
286 |
return (
|
287 |
<Line
|
288 |
-
key={model as string}
|
289 |
type="monotone"
|
290 |
dataKey={selectedMetric as string} // Ensure selectedMetric is a string
|
291 |
data={sortedChartData.filter((row) => row.model === model)}
|
292 |
-
name={model as string}
|
293 |
stroke={colors[index % colors.length]}
|
294 |
dot={false}
|
295 |
/>
|
|
|
14 |
import LoadingSpinner from './LoadingSpinner'
|
15 |
import { ContentType, TooltipProps } from 'recharts/types/component/Tooltip'
|
16 |
import { NameType, ValueType } from 'recharts/types/component/DefaultTooltipContent'
|
17 |
+
import Descriptions from '../Descriptions'
|
18 |
|
19 |
interface LeaderboardChartProps {
|
20 |
dataset: string
|
|
|
83 |
)
|
84 |
}
|
85 |
|
86 |
+
function getModelAlias(model: string): string {
|
87 |
+
return Descriptions.getInstance().getModelAlias(model) || model
|
88 |
+
}
|
89 |
+
|
90 |
const CustomTooltip = (
|
91 |
props: TooltipProps<ValueType, NameType> & {
|
92 |
dataset: string
|
|
|
120 |
</div>
|
121 |
{payload.map((entry: any, i: number) => {
|
122 |
const model = entry.name
|
123 |
+
const originalModel = entry.payload.model
|
124 |
+
|
125 |
const handleClick = () => {
|
126 |
navigate(
|
127 |
+
`${route}?model=${encodeURIComponent(originalModel)}&attack=${encodeURIComponent(selectedAttack || '')}&strength=${strength}`
|
128 |
)
|
129 |
}
|
130 |
|
|
|
292 |
return [...models].map((model, index) => {
|
293 |
return (
|
294 |
<Line
|
295 |
+
key={getModelAlias(model as string)}
|
296 |
type="monotone"
|
297 |
dataKey={selectedMetric as string} // Ensure selectedMetric is a string
|
298 |
data={sortedChartData.filter((row) => row.model === model)}
|
299 |
+
name={getModelAlias(model as string)}
|
300 |
stroke={colors[index % colors.length]}
|
301 |
dot={false}
|
302 |
/>
|
frontend/src/components/ModelFilter.tsx
CHANGED
@@ -38,6 +38,7 @@ const ModelFilter: React.FC<ModelFilterProps> = ({ models, selectedModels, setSe
|
|
38 |
const description = descriptions.current.getModelDescription(model)
|
39 |
const paperUrl = descriptions.current.getModelPaperUrl(model)
|
40 |
const githubUrl = descriptions.current.getModelGithubUrl(model)
|
|
|
41 |
return (
|
42 |
<div key={model} className="flex items-center gap-2 text-sm relative group">
|
43 |
<label className="flex items-center gap-2 flex-grow">
|
@@ -49,7 +50,7 @@ const ModelFilter: React.FC<ModelFilterProps> = ({ models, selectedModels, setSe
|
|
49 |
/>
|
50 |
<div className="flex items-center">
|
51 |
<span className="truncate" title={fullName}>
|
52 |
-
{model}
|
53 |
</span>
|
54 |
<ModelInfoIcon modelName={model} />
|
55 |
</div>
|
|
|
38 |
const description = descriptions.current.getModelDescription(model)
|
39 |
const paperUrl = descriptions.current.getModelPaperUrl(model)
|
40 |
const githubUrl = descriptions.current.getModelGithubUrl(model)
|
41 |
+
const modelAlias = descriptions.current.getModelAlias(model)
|
42 |
return (
|
43 |
<div key={model} className="flex items-center gap-2 text-sm relative group">
|
44 |
<label className="flex items-center gap-2 flex-grow">
|
|
|
50 |
/>
|
51 |
<div className="flex items-center">
|
52 |
<span className="truncate" title={fullName}>
|
53 |
+
{modelAlias || model}
|
54 |
</span>
|
55 |
<ModelInfoIcon modelName={model} />
|
56 |
</div>
|
frontend/src/components/ModelInfoIcon.tsx
CHANGED
@@ -21,6 +21,7 @@ const ModelInfoIcon: React.FC<ModelInfoIconProps> = ({ modelName }) => {
|
|
21 |
const description = descriptions.current.getModelDescription(modelName)
|
22 |
const paperUrl = descriptions.current.getModelPaperUrl(modelName)
|
23 |
const githubUrl = descriptions.current.getModelGithubUrl(modelName)
|
|
|
24 |
|
25 |
return (
|
26 |
<>
|
@@ -51,6 +52,7 @@ const ModelInfoIcon: React.FC<ModelInfoIconProps> = ({ modelName }) => {
|
|
51 |
<div className="mb-2 whitespace-pre-line">
|
52 |
{description || 'No description available.'}
|
53 |
</div>
|
|
|
54 |
<div className="flex space-x-4">
|
55 |
{paperUrl && (
|
56 |
<div>
|
|
|
21 |
const description = descriptions.current.getModelDescription(modelName)
|
22 |
const paperUrl = descriptions.current.getModelPaperUrl(modelName)
|
23 |
const githubUrl = descriptions.current.getModelGithubUrl(modelName)
|
24 |
+
const messageSize = descriptions.current.getModelMessageSize(modelName)
|
25 |
|
26 |
return (
|
27 |
<>
|
|
|
52 |
<div className="mb-2 whitespace-pre-line">
|
53 |
{description || 'No description available.'}
|
54 |
</div>
|
55 |
+
{messageSize !== undefined && <div className="mb-2">Message Size: {messageSize}</div>}
|
56 |
<div className="flex space-x-4">
|
57 |
{paperUrl && (
|
58 |
<div>
|