Upload folder using huggingface_hub

#3
by xianbao HF staff - opened
Files changed (3) hide show
  1. README.md +1 -1
  2. src/pages/index.tsx +19 -20
  3. upload.sh +1 -0
README.md CHANGED
@@ -1,5 +1,5 @@
1
  ---
2
- title: Chinese Open Source Heatmap
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
@@ -23,13 +23,13 @@ export default function Home() {
23
  const [isLoading, setIsLoading] = useState(true);
24
 
25
  const PROVIDERS_MAP: Record<string, { color: string; authors: string[] }> = {
26
- "BAAI": { color: "#ff7000", authors: ["BAAI"] }, // Vibrant Orange
27
- "DeepSeek": { color: "#007ACC", authors: ["deepseek-ai"] }, // Light Blue
28
- "Shanghai AI Lab": { color: "#10A37F", authors: ["internlm", "OpenGVLab", "openmmlab"] }, // Fresh Green
29
- "Alibaba": { color: "#D2691E", authors: ["Qwen", "Alibaba-NLP", "alibaba-pai", "DAMO-NLP-SG"] }, // Chocolate
30
- "GLM": { color: "#4285F4", authors: ["THUDM"] }, // Classic Blue
31
- "Tencent": { color: "#1DA1F2", authors: ["TencentARC", "Tencent-Hunyuan"] }, // Twitter Blue
32
- "Yi/01": { color: "#FF4500", authors: ["01-ai"] }, // Orange-Red
33
  }
34
 
35
  const generateCalendarData = (modelData: ModelData[]) => {
@@ -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
- day.count <= avgCount * 0.5 ? 1 :
74
- day.count <= avgCount ? 2 :
75
- day.count <= avgCount * 1.5 ? 3 : 4;
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">Chinese AI Community: Open Source Heatmap</h1>
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}`}
 
23
  const [isLoading, setIsLoading] = useState(true);
24
 
25
  const PROVIDERS_MAP: Record<string, { color: string; authors: string[] }> = {
26
+ "BAAI": { color: "#FF7000", authors: ["BAAI"] }, // Vibrant Orange, kept the same for consistency
27
+ "DeepSeek": { color: "#1877F2", authors: ["deepseek-ai"] }, // Updated to a darker blue for better contrast
28
+ "Shanghai AI Lab": { color: "#10A37F", authors: ["internlm", "OpenGVLab", "openmmlab"] }, // Fresh Green, unchanged as it already works well
29
+ "Alibaba": { color: "#FF6F00", authors: ["Qwen", "Alibaba-NLP", "alibaba-pai", "DAMO-NLP-SG"] }, // Bright Orange, updated from Chocolate for better contrast
30
+ "GLM": { color: "#4285F4", authors: ["THUDM"] }, // Classic Blue, unchanged for consistency with Google's blue
31
+ "Tencent": { color: "#1DA1F2", authors: ["TencentARC", "Tencent-Hunyuan"] }, // Twitter Blue, unchanged as it’s distinct and works well
32
+ "Yi/01": { color: "#FF4500", authors: ["01-ai"] }, // Orange-Red, unchanged as it provides good contrast
33
  }
34
 
35
  const generateCalendarData = (modelData: ModelData[]) => {
 
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}`}
upload.sh ADDED
@@ -0,0 +1 @@
 
 
1
+ HF_HUB_ENABLE_HF_TRANSFER=1 huggingface-cli upload zh-ai-community/zh-model-release-heatmap . . --repo-type space --create-pr