Upload folder using huggingface_hub
#2
by
xianbao
HF staff
- opened
- README.md +1 -1
- src/pages/index.tsx +12 -13
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 🔥
|
4 |
colorFrom: purple
|
5 |
colorTo: red
|
|
|
1 |
---
|
2 |
+
title: Model Release Heatmap
|
3 |
emoji: 🔥
|
4 |
colorFrom: purple
|
5 |
colorTo: red
|
src/pages/index.tsx
CHANGED
@@ -45,13 +45,13 @@ export default function Home() {
|
|
45 |
// generate daily data for each provider
|
46 |
for (let d = new Date(startDate); d <= today; d.setDate(d.getDate() + 1)) {
|
47 |
const dateString = d.toISOString().split('T')[0];
|
48 |
-
|
49 |
Object.entries(PROVIDERS_MAP).forEach(([provider, { authors }]) => {
|
50 |
-
const count = modelData.filter(item =>
|
51 |
-
item.createdAt.startsWith(dateString) &&
|
52 |
authors.some(author => item.id.startsWith(author))
|
53 |
).length;
|
54 |
-
|
55 |
data[provider].push({ date: dateString, count, level: 0 });
|
56 |
});
|
57 |
}
|
@@ -68,11 +68,11 @@ export default function Home() {
|
|
68 |
Object.entries(data).forEach(([provider, days]) => {
|
69 |
const avgCount = avgCounts[provider];
|
70 |
days.forEach(day => {
|
71 |
-
day.level =
|
72 |
day.count === 0 ? 0 :
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
});
|
77 |
});
|
78 |
|
@@ -111,29 +111,28 @@ export default function Home() {
|
|
111 |
|
112 |
return (
|
113 |
<main className={`flex flex-col items-center justify-center min-h-screen mx-auto p-24 ${inter.className}`}>
|
114 |
-
<h1 className="text-5xl font-bold text-center">
|
115 |
<p className="text-center mt-2 text-sm">A heatmap for open source model releases.</p>
|
116 |
-
<p className="text-center mt-2 text-sm">Huge thanks to Caleb for the excellent original work. <a href="https://huggingface.co/spaces/cfahlgren1/model-release-heatmap" target="_blank">Link</a> to the original repo</p>
|
117 |
<div className="mt-16">
|
118 |
{isLoading ? (
|
119 |
<p>Loading...</p>
|
120 |
) : (
|
121 |
<>
|
122 |
{Object.entries(PROVIDERS_MAP)
|
123 |
-
.sort(([keyA], [keyB]) =>
|
124 |
calendarData[keyB].reduce((sum, day) => sum + day.count, 0) -
|
125 |
calendarData[keyA].reduce((sum, day) => sum + day.count, 0)
|
126 |
)
|
127 |
.map(([providerName, { color }]) => (
|
128 |
<div key={providerName} className="mb-8">
|
129 |
<h2 className="text-2xl font-bold mb-2">{providerName}</h2>
|
130 |
-
<ActivityCalendar
|
131 |
data={calendarData[providerName]}
|
132 |
theme={{
|
133 |
dark: ['#161b22', color],
|
|
|
134 |
}}
|
135 |
hideTotalCount
|
136 |
-
colorScheme="dark"
|
137 |
renderBlock={(block, activity) => (
|
138 |
<MuiTooltip
|
139 |
title={`${activity.count} models created on ${activity.date}`}
|
|
|
45 |
// generate daily data for each provider
|
46 |
for (let d = new Date(startDate); d <= today; d.setDate(d.getDate() + 1)) {
|
47 |
const dateString = d.toISOString().split('T')[0];
|
48 |
+
|
49 |
Object.entries(PROVIDERS_MAP).forEach(([provider, { authors }]) => {
|
50 |
+
const count = modelData.filter(item =>
|
51 |
+
item.createdAt.startsWith(dateString) &&
|
52 |
authors.some(author => item.id.startsWith(author))
|
53 |
).length;
|
54 |
+
|
55 |
data[provider].push({ date: dateString, count, level: 0 });
|
56 |
});
|
57 |
}
|
|
|
68 |
Object.entries(data).forEach(([provider, days]) => {
|
69 |
const avgCount = avgCounts[provider];
|
70 |
days.forEach(day => {
|
71 |
+
day.level =
|
72 |
day.count === 0 ? 0 :
|
73 |
+
day.count <= avgCount * 0.5 ? 1 :
|
74 |
+
day.count <= avgCount ? 2 :
|
75 |
+
day.count <= avgCount * 1.5 ? 3 : 4;
|
76 |
});
|
77 |
});
|
78 |
|
|
|
111 |
|
112 |
return (
|
113 |
<main className={`flex flex-col items-center justify-center min-h-screen mx-auto p-24 ${inter.className}`}>
|
114 |
+
<h1 className="text-5xl font-bold text-center">Open Source Heatmap</h1>
|
115 |
<p className="text-center mt-2 text-sm">A heatmap for open source model releases.</p>
|
|
|
116 |
<div className="mt-16">
|
117 |
{isLoading ? (
|
118 |
<p>Loading...</p>
|
119 |
) : (
|
120 |
<>
|
121 |
{Object.entries(PROVIDERS_MAP)
|
122 |
+
.sort(([keyA], [keyB]) =>
|
123 |
calendarData[keyB].reduce((sum, day) => sum + day.count, 0) -
|
124 |
calendarData[keyA].reduce((sum, day) => sum + day.count, 0)
|
125 |
)
|
126 |
.map(([providerName, { color }]) => (
|
127 |
<div key={providerName} className="mb-8">
|
128 |
<h2 className="text-2xl font-bold mb-2">{providerName}</h2>
|
129 |
+
<ActivityCalendar
|
130 |
data={calendarData[providerName]}
|
131 |
theme={{
|
132 |
dark: ['#161b22', color],
|
133 |
+
light: ['#e0e0e0', color],
|
134 |
}}
|
135 |
hideTotalCount
|
|
|
136 |
renderBlock={(block, activity) => (
|
137 |
<MuiTooltip
|
138 |
title={`${activity.count} models created on ${activity.date}`}
|