Spaces:
Running
Running
Commit
·
81b0d11
1
Parent(s):
f6b7f82
Update API filter and README title to focus on tools gallery
Browse files- README.md +2 -2
- index.html +6 -6
README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: indigo
|
5 |
colorTo: indigo
|
6 |
sdk: static
|
|
|
1 |
---
|
2 |
+
title: smolagents and tools gallery
|
3 |
+
emoji: 🎨
|
4 |
colorFrom: indigo
|
5 |
colorTo: indigo
|
6 |
sdk: static
|
index.html
CHANGED
@@ -117,7 +117,7 @@
|
|
117 |
data = await res.json();
|
118 |
} else {
|
119 |
const res = await fetch(
|
120 |
-
'https://huggingface.co/api/spaces?limit=100&filter=
|
121 |
);
|
122 |
data = await res.json();
|
123 |
console.log(data)
|
@@ -129,22 +129,22 @@
|
|
129 |
lastModified: item.lastModified
|
130 |
}));
|
131 |
}
|
132 |
-
|
133 |
if (sort === 'likes') {
|
134 |
data.sort((a, b) => (b.likes - a.likes));
|
135 |
} else {
|
136 |
data.sort((a, b) => (new Date(b.lastModified) - new Date(a.lastModified)));
|
137 |
}
|
138 |
-
|
139 |
const pageThemes = data.slice((page - 1) * 15, page * 15);
|
140 |
-
|
141 |
console.log(pageThemes);
|
142 |
-
|
143 |
return {
|
144 |
themes: pageThemes,
|
145 |
totalPages: Math.ceil(data.length / 15)
|
146 |
};
|
147 |
-
},
|
148 |
async nextPage() {
|
149 |
if (this.page < this.totalPages) {
|
150 |
this.page += 1;
|
|
|
117 |
data = await res.json();
|
118 |
} else {
|
119 |
const res = await fetch(
|
120 |
+
'https://huggingface.co/api/spaces?limit=100&filter=tools&expand[]=subdomain&expand[]=lastModified&expand[]=likes&expand[]=runtime'
|
121 |
);
|
122 |
data = await res.json();
|
123 |
console.log(data)
|
|
|
129 |
lastModified: item.lastModified
|
130 |
}));
|
131 |
}
|
132 |
+
|
133 |
if (sort === 'likes') {
|
134 |
data.sort((a, b) => (b.likes - a.likes));
|
135 |
} else {
|
136 |
data.sort((a, b) => (new Date(b.lastModified) - new Date(a.lastModified)));
|
137 |
}
|
138 |
+
|
139 |
const pageThemes = data.slice((page - 1) * 15, page * 15);
|
140 |
+
|
141 |
console.log(pageThemes);
|
142 |
+
|
143 |
return {
|
144 |
themes: pageThemes,
|
145 |
totalPages: Math.ceil(data.length / 15)
|
146 |
};
|
147 |
+
},
|
148 |
async nextPage() {
|
149 |
if (this.page < this.totalPages) {
|
150 |
this.page += 1;
|