Spaces:
Running
Running
remove uncategorized mentions
Browse files
client/src/context/LeaderboardContext.jsx
CHANGED
@@ -39,7 +39,6 @@ export const LeaderboardProvider = ({ children }) => {
|
|
39 |
params.languageExpanded === "true"
|
40 |
);
|
41 |
|
42 |
-
// Mettre à jour l'URL quand les filtres changent
|
43 |
useEffect(() => {
|
44 |
updateParams({
|
45 |
categories: Array.from(selectedCategories),
|
@@ -60,39 +59,20 @@ export const LeaderboardProvider = ({ children }) => {
|
|
60 |
updateParams,
|
61 |
]);
|
62 |
|
63 |
-
// Logger les leaderboards non catégorisés
|
64 |
useEffect(() => {
|
65 |
if (leaderboards.length > 0) {
|
66 |
const uncategorizedLeaderboards = leaderboards.filter(
|
67 |
(board) =>
|
68 |
board.approval_status === "approved" && isUncategorizedBoard(board)
|
69 |
);
|
70 |
-
|
71 |
-
if (uncategorizedLeaderboards.length > 0) {
|
72 |
-
console.log("=== LEADERBOARDS NON CATÉGORISÉS ===");
|
73 |
-
console.log(
|
74 |
-
`Total: ${uncategorizedLeaderboards.length} leaderboards non catégorisés`
|
75 |
-
);
|
76 |
-
console.table(
|
77 |
-
uncategorizedLeaderboards.map((board) => ({
|
78 |
-
id: board.id,
|
79 |
-
uid: board.uid,
|
80 |
-
title: board.card_data?.title || "Sans titre",
|
81 |
-
tags: (board.tags || []).join(", "),
|
82 |
-
url: board.card_data?.url || "",
|
83 |
-
}))
|
84 |
-
);
|
85 |
-
}
|
86 |
}
|
87 |
}, [leaderboards]);
|
88 |
|
89 |
-
// Wrapper pour setSelectedCategories qui gère aussi l'expansion des sections
|
90 |
const handleCategorySelection = useCallback((categoryId) => {
|
91 |
setSelectedCategories((prev) => {
|
92 |
const newCategories = new Set(prev);
|
93 |
if (newCategories.has(categoryId)) {
|
94 |
newCategories.delete(categoryId);
|
95 |
-
// Si on désélectionne, on replie la section
|
96 |
setExpandedSections((prev) => {
|
97 |
const newExpanded = new Set(prev);
|
98 |
newExpanded.delete(categoryId);
|
|
|
39 |
params.languageExpanded === "true"
|
40 |
);
|
41 |
|
|
|
42 |
useEffect(() => {
|
43 |
updateParams({
|
44 |
categories: Array.from(selectedCategories),
|
|
|
59 |
updateParams,
|
60 |
]);
|
61 |
|
|
|
62 |
useEffect(() => {
|
63 |
if (leaderboards.length > 0) {
|
64 |
const uncategorizedLeaderboards = leaderboards.filter(
|
65 |
(board) =>
|
66 |
board.approval_status === "approved" && isUncategorizedBoard(board)
|
67 |
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
}
|
69 |
}, [leaderboards]);
|
70 |
|
|
|
71 |
const handleCategorySelection = useCallback((categoryId) => {
|
72 |
setSelectedCategories((prev) => {
|
73 |
const newCategories = new Set(prev);
|
74 |
if (newCategories.has(categoryId)) {
|
75 |
newCategories.delete(categoryId);
|
|
|
76 |
setExpandedSections((prev) => {
|
77 |
const newExpanded = new Set(prev);
|
78 |
newExpanded.delete(categoryId);
|
client/src/pages/LeaderboardPage/LeaderboardPage.jsx
CHANGED
@@ -50,7 +50,6 @@ const LeaderboardPageContent = () => {
|
|
50 |
);
|
51 |
}, [allSections]);
|
52 |
|
53 |
-
// Calculer le nombre de leaderboards non catégorisés
|
54 |
const uncategorizedLeaderboards = useMemo(() => {
|
55 |
if (!leaderboards || leaderboards.length === 0) return [];
|
56 |
return leaderboards.filter(
|
@@ -132,33 +131,6 @@ const LeaderboardPageContent = () => {
|
|
132 |
<span style={{ fontWeight: 600 }}>explore</span> all leaderboards from
|
133 |
the <span style={{ fontWeight: 600 }}>Hugging Face community</span>
|
134 |
</Typography>
|
135 |
-
|
136 |
-
{uncategorizedLeaderboards.length > 0 && (
|
137 |
-
<Tooltip
|
138 |
-
title={`${uncategorizedLeaderboards.length} leaderboards approuvés n'ont pas de catégorie et ne sont pas affichés dans les sections`}
|
139 |
-
>
|
140 |
-
<Chip
|
141 |
-
icon={<WarningAmberIcon />}
|
142 |
-
label={`${uncategorizedLeaderboards.length} leaderboards non catégorisés`}
|
143 |
-
color="warning"
|
144 |
-
variant="outlined"
|
145 |
-
sx={{ mt: 1 }}
|
146 |
-
onClick={() => {
|
147 |
-
console.log("=== LEADERBOARDS NON CATÉGORISÉS ===");
|
148 |
-
console.table(
|
149 |
-
uncategorizedLeaderboards.map((board) => ({
|
150 |
-
id: board.id,
|
151 |
-
uid: board.uid,
|
152 |
-
title: board.card_data?.title || "Sans titre",
|
153 |
-
tags: (board.tags || []).join(", "),
|
154 |
-
url: board.card_data?.url || "",
|
155 |
-
}))
|
156 |
-
);
|
157 |
-
setShowUncategorized(!showUncategorized);
|
158 |
-
}}
|
159 |
-
/>
|
160 |
-
</Tooltip>
|
161 |
-
)}
|
162 |
</Box>
|
163 |
|
164 |
{loading ? (
|
@@ -176,28 +148,6 @@ const LeaderboardPageContent = () => {
|
|
176 |
>
|
177 |
<LeaderboardFilters allSections={allSections} />
|
178 |
|
179 |
-
{/* Section pour les leaderboards non catégorisés */}
|
180 |
-
{showUncategorized && uncategorizedLeaderboards.length > 0 && (
|
181 |
-
<Box
|
182 |
-
sx={{
|
183 |
-
mb: 4,
|
184 |
-
p: 2,
|
185 |
-
border: "1px dashed",
|
186 |
-
borderColor: "warning.main",
|
187 |
-
borderRadius: 2,
|
188 |
-
bgcolor: (theme) => theme.palette.warning.light + "20",
|
189 |
-
}}
|
190 |
-
>
|
191 |
-
<LeaderboardSection
|
192 |
-
id="uncategorized"
|
193 |
-
title={`Leaderboards non catégorisés (${uncategorizedLeaderboards.length})`}
|
194 |
-
leaderboards={uncategorizedLeaderboards}
|
195 |
-
filteredLeaderboards={uncategorizedLeaderboards}
|
196 |
-
showEmptyState={false}
|
197 |
-
/>
|
198 |
-
</Box>
|
199 |
-
)}
|
200 |
-
|
201 |
{isOnlyTextSearch ? (
|
202 |
// Vue spéciale pour la recherche textuelle
|
203 |
searchResults.length > 0 ? (
|
|
|
50 |
);
|
51 |
}, [allSections]);
|
52 |
|
|
|
53 |
const uncategorizedLeaderboards = useMemo(() => {
|
54 |
if (!leaderboards || leaderboards.length === 0) return [];
|
55 |
return leaderboards.filter(
|
|
|
131 |
<span style={{ fontWeight: 600 }}>explore</span> all leaderboards from
|
132 |
the <span style={{ fontWeight: 600 }}>Hugging Face community</span>
|
133 |
</Typography>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
</Box>
|
135 |
|
136 |
{loading ? (
|
|
|
148 |
>
|
149 |
<LeaderboardFilters allSections={allSections} />
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
{isOnlyTextSearch ? (
|
152 |
// Vue spéciale pour la recherche textuelle
|
153 |
searchResults.length > 0 ? (
|
client/src/utils/filterUtils.js
CHANGED
@@ -29,28 +29,52 @@ export const CATEGORY_TAG_MAPPING = {
|
|
29 |
|
30 |
// Constantes pour les tags de catégorisation
|
31 |
export const CATEGORIZATION_TAGS = [
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
"modality:agent",
|
33 |
"modality:artefacts",
|
34 |
-
|
35 |
-
|
36 |
-
"eval:
|
37 |
"eval:reasoning",
|
|
|
|
|
|
|
|
|
|
|
38 |
"eval:hallucination",
|
39 |
-
|
40 |
-
|
41 |
-
"modality:3d",
|
42 |
-
"modality:audio",
|
43 |
-
"domain:financial",
|
44 |
"domain:medical",
|
45 |
-
"domain:legal",
|
46 |
-
"domain:biology",
|
47 |
-
"domain:translation",
|
48 |
"domain:chemistry",
|
49 |
"domain:physics",
|
|
|
|
|
|
|
50 |
"domain:commercial",
|
51 |
-
"
|
52 |
-
|
53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
];
|
55 |
|
56 |
/**
|
|
|
29 |
|
30 |
// Constantes pour les tags de catégorisation
|
31 |
export const CATEGORIZATION_TAGS = [
|
32 |
+
// Modalities
|
33 |
+
"modality:text",
|
34 |
+
"modality:image",
|
35 |
+
"modality:audio",
|
36 |
+
"modality:video",
|
37 |
+
"modality:3d",
|
38 |
"modality:agent",
|
39 |
"modality:artefacts",
|
40 |
+
|
41 |
+
// Evaluation categories
|
42 |
+
"eval:generation",
|
43 |
"eval:reasoning",
|
44 |
+
"eval:math",
|
45 |
+
"eval:code",
|
46 |
+
"eval:performance",
|
47 |
+
"eval:safety",
|
48 |
+
"eval:rag",
|
49 |
"eval:hallucination",
|
50 |
+
|
51 |
+
// Domains
|
|
|
|
|
|
|
52 |
"domain:medical",
|
|
|
|
|
|
|
53 |
"domain:chemistry",
|
54 |
"domain:physics",
|
55 |
+
"domain:biology",
|
56 |
+
"domain:financial",
|
57 |
+
"domain:legal",
|
58 |
"domain:commercial",
|
59 |
+
"domain:translation",
|
60 |
+
|
61 |
+
// Judges
|
62 |
+
"judge:humans",
|
63 |
+
"judge:function",
|
64 |
+
"judge:model",
|
65 |
+
"judge:vibe check",
|
66 |
+
|
67 |
+
// Test sets
|
68 |
+
"test:public",
|
69 |
+
"test:mix",
|
70 |
+
"test:private",
|
71 |
+
"test:rolling",
|
72 |
+
|
73 |
+
// Submission types
|
74 |
+
"submission:automatic",
|
75 |
+
"submission:semiautomatic",
|
76 |
+
"submission:manual",
|
77 |
+
"submission:closed",
|
78 |
];
|
79 |
|
80 |
/**
|