Spaces:
Running
Running
Update index.html
Browse files- index.html +254 -358
index.html
CHANGED
@@ -1,374 +1,270 @@
|
|
1 |
-
|
2 |
<html>
|
3 |
-
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="viewport" content="width=device-width" />
|
6 |
<title>Smolagents and tools gallery</title>
|
7 |
<meta name="description" content="Discover all smolagents and tools created by the community." />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
|
9 |
<script src="https://cdn.tailwindcss.com"></script>
|
10 |
<style>
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
display: block;
|
69 |
-
border: none;
|
70 |
-
width: 100%;
|
71 |
-
height: 600px;
|
72 |
-
pointer-events: none;
|
73 |
-
margin-top: 48px; /* Match header height */
|
74 |
-
}
|
75 |
-
.grid-container {
|
76 |
-
display: grid;
|
77 |
-
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
78 |
-
grid-gap: 10px;
|
79 |
-
margin-top: 3.5rem;
|
80 |
-
}
|
81 |
-
.grid-item {
|
82 |
-
position: relative;
|
83 |
-
overflow-y: hidden;
|
84 |
-
border-radius: 10px;
|
85 |
-
border: 1px solid rgb(55 65 81);
|
86 |
-
}
|
87 |
-
.grid-item:hover {
|
88 |
-
filter: brightness(75%);
|
89 |
-
}
|
90 |
-
.grid-item a {
|
91 |
-
position: absolute;
|
92 |
-
top: 0;
|
93 |
-
left: 0;
|
94 |
-
width: 100%;
|
95 |
-
height: 100%;
|
96 |
-
display: block;
|
97 |
-
z-index: 1;
|
98 |
-
}
|
99 |
-
.grid-item-header {
|
100 |
-
position: absolute;
|
101 |
-
top: 0;
|
102 |
-
left: 0;
|
103 |
-
right: 0;
|
104 |
-
height: 48px;
|
105 |
-
background: rgba(0,0,0,0.75);
|
106 |
-
padding: 8px 16px;
|
107 |
-
z-index: 10;
|
108 |
-
display: flex;
|
109 |
-
align-items: center;
|
110 |
-
width: 100%;
|
111 |
-
}
|
112 |
-
.grid-item-header h2 {
|
113 |
-
width: 100%;
|
114 |
-
overflow-wrap: break-word;
|
115 |
-
word-wrap: break-word;
|
116 |
-
hyphens: auto;
|
117 |
-
max-height: 32px;
|
118 |
-
overflow: hidden;
|
119 |
-
display: -webkit-box;
|
120 |
-
-webkit-line-clamp: 2;
|
121 |
-
-webkit-box-orient: vertical;
|
122 |
-
line-height: 1.2;
|
123 |
-
}
|
124 |
</style>
|
125 |
<script type="module">
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
246 |
</script>
|
247 |
-
</head>
|
248 |
-
<body class="pb-10 pt-5 bg-white relative">
|
249 |
<section x-data="themesData">
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
</div>
|
277 |
-
</div>
|
278 |
-
<div class="flex gap-2">
|
279 |
-
<span class="md:px-3 py-1 text-gray-800">type</span>
|
280 |
-
<button:class="buttonClass('filter', 'tool')" @click="filterType('tool')">Tools</button>
|
281 |
-
<button:class="buttonClass('filter', 'agent')" @click="filterType('agent')">Agents</button>
|
282 |
-
</div>
|
283 |
-
<div class="flex gap-2">
|
284 |
-
<span class="md:px-3 py-1 text-gray-800">sort by</span>
|
285 |
-
<button:class="buttonClass('sort', 'likes')" @click="sortThemes('likes')">Most Likes</button>
|
286 |
-
<button:class="buttonClass('sort', 'recent')" @click="sortThemes('recent')">Recent</button>
|
287 |
-
</div>
|
288 |
-
</div>
|
289 |
-
</section>
|
290 |
-
<div class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 mx-auto my-8 relative">
|
291 |
-
<template x-for="theme in themes":key="theme.id">
|
292 |
-
<div class="grid-item">
|
293 |
-
<div class="grid-item-header">
|
294 |
-
<h2 class="text-sm font-medium text-white" x-text="theme.id"></h2>
|
295 |
-
</div>
|
296 |
-
<iframe:src="`<span class="math-inline">\{theme\.subdomain\}?\_\=</span>{new Date().getTime()}`":alt="theme.id" scrolling="no" frameborder="0" loading="lazy"></iframe>
|
297 |
-
<a:href="`https://huggingface.co/spaces/${theme.id}`" target="_blank"></a>
|
298 |
-
</div>
|
299 |
-
</template>
|
300 |
-
<div class="grid-item">
|
301 |
-
<div class="grid-item-header">
|
302 |
-
<h2 class="text-sm font-medium text-white">smolagents Playground</h2>
|
303 |
-
</div>
|
304 |
-
|
305 |
-
<div id="playground-container">
|
306 |
-
<div id="tool-select">
|
307 |
-
<label for="tools">Select Tools:</label><br>
|
308 |
-
<select id="tools" multiple>
|
309 |
-
<option value="DuckDuckGoSearchTool">DuckDuckGoSearchTool</option>
|
310 |
-
</select>
|
311 |
-
</div>
|
312 |
-
|
313 |
-
<div id="input-container">
|
314 |
-
<label for="user-input">Enter your query:</label><br>
|
315 |
-
<textarea id="user-input" rows="5"></textarea><br>
|
316 |
-
<button id="run-button">Run Agent</button>
|
317 |
-
<div id="loading-indicator">Running...</div>
|
318 |
-
<div id="error-message"></div>
|
319 |
-
</div>
|
320 |
-
|
321 |
-
<div id="output-container">
|
322 |
-
<p>Agent output:</p>
|
323 |
-
<div id="output"></div>
|
324 |
-
</div>
|
325 |
-
</div>
|
326 |
-
|
327 |
-
<a href="https://huggingface.co/spaces/your-username/your-space-name" target="_blank"></a>
|
328 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
</div>
|
330 |
-
|
331 |
-
|
332 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
333 |
</section>
|
334 |
-
|
335 |
-
<script>
|
336 |
-
document.getElementById('run-button').addEventListener('click', async () => {
|
337 |
-
const userInput = document.getElementById('user-input').value;
|
338 |
-
const outputDiv = document.getElementById('output');
|
339 |
-
const loadingIndicator = document.getElementById('loading-indicator');
|
340 |
-
const errorMessage = document.getElementById('error-message');
|
341 |
-
|
342 |
-
outputDiv.textContent = "";
|
343 |
-
errorMessage.textContent = "";
|
344 |
-
loadingIndicator.style.display = 'block';
|
345 |
-
|
346 |
-
const selectedTools = Array.from(document.getElementById('tools').selectedOptions).map(option => option.value);
|
347 |
-
|
348 |
-
try {const response = await fetch('/run_agent', {
|
349 |
-
method: 'POST',
|
350 |
-
headers: {
|
351 |
-
'Content-Type': 'application/json'
|
352 |
-
},
|
353 |
-
body: JSON.stringify({
|
354 |
-
query: userInput,
|
355 |
-
tools: selectedTools
|
356 |
-
})
|
357 |
-
});
|
358 |
-
|
359 |
-
loadingIndicator.style.display = 'none';
|
360 |
-
|
361 |
-
if (response.ok) {
|
362 |
-
const data = await response.json();
|
363 |
-
outputDiv.textContent = data.result;
|
364 |
-
} else {
|
365 |
-
errorMessage.textContent = `Error: ${response.statusText}`;
|
366 |
-
}
|
367 |
-
} catch (error) {
|
368 |
-
loadingIndicator.style.display = 'none';
|
369 |
-
errorMessage.textContent = `Error: ${error.message}`;
|
370 |
-
}
|
371 |
-
});
|
372 |
-
</script>
|
373 |
-
</body>
|
374 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
<html>
|
3 |
+
<head>
|
4 |
<meta charset="utf-8" />
|
5 |
<meta name="viewport" content="width=device-width" />
|
6 |
<title>Smolagents and tools gallery</title>
|
7 |
<meta name="description" content="Discover all smolagents and tools created by the community." />
|
8 |
+
<meta property="og:url" content="https://smolagents-tools-gallery.hf.space/" />
|
9 |
+
<meta property="og:type" content="website" />
|
10 |
+
<meta property="og:title" content="smolagents and tools gallery" />
|
11 |
+
<meta property="og:description" content="Discover all smolagents and tools created by the community." />
|
12 |
+
<meta property="og:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" />
|
13 |
+
<meta name="twitter:card" content="player" />
|
14 |
+
<meta property="twitter:url" content="https://davidberenstein1957-smolagents-and-tools.static.hf.space" />
|
15 |
+
<meta name="twitter:description" content="Discover all smolagents and tools created by the community." />
|
16 |
+
<meta name="twitter:site" content="@huggingface" />
|
17 |
+
<meta name="twitter:title" content="smolagents and tools gallery" />
|
18 |
+
<meta name="twitter:image" content="https://huggingface-projects-diffusers-gallery.hf.space/Fo6vR6JX0AEjbw1.jpeg" />
|
19 |
+
<meta name="twitter:player" content="https://davidberenstein1957-smolagents-and-tools.static.hf.space" />
|
20 |
+
<meta name="twitter:player:width" content="100%" />
|
21 |
+
<meta name="twitter:player:height" content="600" />
|
22 |
<script src="https://cdnjs.cloudflare.com/ajax/libs/iframe-resizer/4.3.1/iframeResizer.contentWindow.min.js"></script>
|
23 |
<script src="https://cdn.tailwindcss.com"></script>
|
24 |
<style>
|
25 |
+
iframe {
|
26 |
+
display: block;
|
27 |
+
border: none;
|
28 |
+
width: 100%;
|
29 |
+
height: 600px;
|
30 |
+
pointer-events: none;
|
31 |
+
margin-top: 48px; /* Match header height */
|
32 |
+
}
|
33 |
+
.grid-container {
|
34 |
+
display: grid;
|
35 |
+
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
36 |
+
grid-gap: 10px;
|
37 |
+
margin-top: 3.5rem;
|
38 |
+
}
|
39 |
+
.grid-item {
|
40 |
+
position: relative;
|
41 |
+
overflow-y: hidden;
|
42 |
+
border-radius: 10px;
|
43 |
+
border: 1px solid rgb(55 65 81);
|
44 |
+
}
|
45 |
+
.grid-item:hover {
|
46 |
+
filter: brightness(75%);
|
47 |
+
}
|
48 |
+
.grid-item a {
|
49 |
+
position: absolute;
|
50 |
+
top: 0;
|
51 |
+
left: 0;
|
52 |
+
width: 100%;
|
53 |
+
height: 100%;
|
54 |
+
display: block;
|
55 |
+
z-index: 1;
|
56 |
+
}
|
57 |
+
.grid-item-header {
|
58 |
+
position: absolute;
|
59 |
+
top: 0;
|
60 |
+
left: 0;
|
61 |
+
right: 0;
|
62 |
+
height: 48px;
|
63 |
+
background: rgba(0,0,0,0.75);
|
64 |
+
padding: 8px 16px;
|
65 |
+
z-index: 10;
|
66 |
+
display: flex;
|
67 |
+
align-items: center;
|
68 |
+
width: 100%;
|
69 |
+
}
|
70 |
+
.grid-item-header h2 {
|
71 |
+
width: 100%;
|
72 |
+
overflow-wrap: break-word;
|
73 |
+
word-wrap: break-word;
|
74 |
+
hyphens: auto;
|
75 |
+
max-height: 32px;
|
76 |
+
overflow: hidden;
|
77 |
+
display: -webkit-box;
|
78 |
+
-webkit-line-clamp: 2;
|
79 |
+
-webkit-box-orient: vertical;
|
80 |
+
line-height: 1.2;
|
81 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
82 |
</style>
|
83 |
<script type="module">
|
84 |
+
import Alpine from "https://cdn.skypack.dev/[email protected]";
|
85 |
+
import Intersect from "https://cdn.skypack.dev/@alpinejs/intersect";
|
86 |
+
Alpine.plugin(Intersect);
|
87 |
+
Alpine.data("themesData", () => ({
|
88 |
+
async init() {
|
89 |
+
const data = await this.getThemes(this.page, this.sort, this.useTestData);
|
90 |
+
this.themes = data.themes;
|
91 |
+
this.totalPages = data.totalPages;
|
92 |
+
},
|
93 |
+
themes:,
|
94 |
+
filter: "tool",
|
95 |
+
sort: "likes",
|
96 |
+
page: 1,
|
97 |
+
totalPages: -1,
|
98 |
+
useTestData: false,
|
99 |
+
searchQuery: "",
|
100 |
+
searchType: "keyword",
|
101 |
+
hfToken: "", // New property for Hugging Face token
|
102 |
+
userSpaces:, // New property to store user spaces
|
103 |
+
buttonClass(attr, filter) {
|
104 |
+
if (this[attr] === filter) {
|
105 |
+
return "text-orange-600 bg-gradient-to-br from-orange-300 to-orange-100 px-2 md:px-3 py-1 rounded-full";
|
106 |
+
}
|
107 |
+
return "text-gray-800 hover:to-orange-300/100 hover:text-orange-600 dark:hover:bg-white";
|
108 |
+
},
|
109 |
+
async switchData() {
|
110 |
+
this.page = 1;
|
111 |
+
this.useTestData =!this.useTestData;
|
112 |
+
const data = await this.getThemes(this.page, this.sort, this.useTestData);
|
113 |
+
this.themes = data.themes;
|
114 |
+
this.totalPages = data.totalPages;
|
115 |
+
},
|
116 |
+
async sortThemes(sort) {
|
117 |
+
this.sort = sort;
|
118 |
+
this.page = 1;
|
119 |
+
const data = await this.getThemes(this.page, this.sort, this.useTestData);
|
120 |
+
this.themes = data.themes;
|
121 |
+
this.totalPages = data.totalPages;
|
122 |
+
},
|
123 |
+
async filterType(filter) {
|
124 |
+
this.filter = filter;
|
125 |
+
this.page = 1;
|
126 |
+
if (this.searchQuery) {
|
127 |
+
await this.searchThemes();
|
128 |
+
} else {
|
129 |
+
const data = await this.getThemes(this.page, this.sort, this.useTestData);
|
130 |
+
this.themes = data.themes;
|
131 |
+
this.totalPages = data.totalPages;
|
132 |
+
}
|
133 |
+
},
|
134 |
+
async searchThemes() {
|
135 |
+
this.page = 1;
|
136 |
+
const data = await this.getThemes(this.page, this.sort, this.useTestData);
|
137 |
+
this.themes = data.themes;
|
138 |
+
this.totalPages = data.totalPages;
|
139 |
+
},
|
140 |
+
async switchSearchType(type) {
|
141 |
+
this.searchType = type;
|
142 |
+
if (this.searchQuery) {
|
143 |
+
await this.searchThemes();
|
144 |
+
}
|
145 |
+
},
|
146 |
+
async getUserSpaces() {
|
147 |
+
if (!this.hfToken) {
|
148 |
+
alert("Please enter your Hugging Face token.");
|
149 |
+
return;
|
150 |
+
}
|
151 |
+
try {
|
152 |
+
const res = await fetch(`https://huggingface.co/api/spaces?token=${this.hfToken}`);
|
153 |
+
if (!res.ok) {
|
154 |
+
throw new Error(`Failed to fetch spaces: ${res.status} ${res.statusText}`);
|
155 |
+
}
|
156 |
+
const data = await res.json();
|
157 |
+
this.userSpaces = data;
|
158 |
+
} catch (error) {
|
159 |
+
alert(`Error fetching spaces: ${error.message}`);
|
160 |
+
}
|
161 |
+
},
|
162 |
+
async getThemes(page, sort, useTestData) {
|
163 |
+
let data;
|
164 |
+
if (useTestData) {
|
165 |
+
const res = await fetch(
|
166 |
+
`https://huggingface.co/datasets/freddyaboulton/gradio-theme-subdomains/resolve/main/test_data.json`
|
167 |
+
);
|
168 |
+
data = await res.json();
|
169 |
+
} else {
|
170 |
+
const searchFilters = this.filter === 'tool'? 'tool': 'smolagents';
|
171 |
+
let searchUrl;
|
172 |
+
if (this.searchQuery) {
|
173 |
+
if (this.searchType === 'semantic') {
|
174 |
+
searchUrl = `https://huggingface.co/api/spaces/semantic-search?limit=100&filter=${searchFilters}&q=${encodeURIComponent(this.searchQuery)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
|
175 |
+
} else {
|
176 |
+
searchUrl = `https://huggingface.co/api/spaces?limit=100&filter=${searchFilters}&search=${encodeURIComponent(this.searchQuery)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
|
177 |
+
}
|
178 |
+
} else {
|
179 |
+
searchUrl = `https://huggingface.co/api/spaces?limit=100&filter=${encodeURIComponent(searchFilters)}&expand=subdomain&expand=lastModified&expand=likes&expand=runtime`;
|
180 |
+
}
|
181 |
+
const res = await fetch(searchUrl);
|
182 |
+
data = await res.json();
|
183 |
+
// Transform the API response to match the expected format
|
184 |
+
data = data.filter(item => item.runtime?.stage === "RUNNING").map(item => ({
|
185 |
+
id: item.id,
|
186 |
+
subdomain: `https://${item.subdomain}.hf.space`,
|
187 |
+
likes: item.likes,
|
188 |
+
lastModified: item.lastModified
|
189 |
+
}));
|
190 |
+
}
|
191 |
+
if (sort === 'likes') {
|
192 |
+
data.sort((a, b) => (b.likes - a.likes));
|
193 |
+
} else {
|
194 |
+
data.sort((a, b) => (new Date(b.lastModified) - new Date(a.lastModified)));
|
195 |
+
}
|
196 |
+
const pageThemes = data.slice((page - 1) * 15, page * 15);
|
197 |
+
return {
|
198 |
+
themes: pageThemes,
|
199 |
+
totalPages: Math.ceil(data.length / 15)
|
200 |
+
};
|
201 |
+
},
|
202 |
+
async nextPage() {
|
203 |
+
if (this.page < this.totalPages) {
|
204 |
+
this.page += 1;
|
205 |
+
const data = await this.getThemes(this.page, this.sort, this.useTestData);
|
206 |
+
this.themes = this.themes.concat(data.themes);
|
207 |
+
this.totalPages = data.totalPages;
|
208 |
+
}
|
209 |
+
},
|
210 |
+
}));
|
211 |
+
Alpine.start();
|
212 |
</script>
|
213 |
+
</head>
|
214 |
+
<body class="pb-10 pt-5 bg-white relative">
|
215 |
<section x-data="themesData">
|
216 |
+
<section class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-14 mx-auto relative">
|
217 |
+
<div class="col-span-2 lg:col-span-1 flex flex-col gap-14 row-start">
|
218 |
+
<div class="flex items-center gap-2">
|
219 |
+
<img src="https://camo.githubusercontent.com/a8c1f1d12aa3114010c6e74b29d47fee91d8da10a915f065c38e6d0ea7f16568/68747470733a2f2f68756767696e67666163652e636f2f64617461736574732f68756767696e67666163652f646f63756d656e746174696f6e2d696d616765732f7265736f6c76652f6d61696e2f736d6f6c6167656e74732f6d6173636f742e706e67" alt="Smolagents mascot" class="w-14 h-14 flex-shrink-0">
|
220 |
+
<h1 class="text-xl font-semibold text-gray-800 break-words">smolagents and tools gallery</h1>
|
221 |
+
</div>
|
222 |
+
<div class="flex items-center gap-2">
|
223 |
+
<input
|
224 |
+
type="text"
|
225 |
+
x-model="hfToken"
|
226 |
+
placeholder="Enter your Hugging Face Token"
|
227 |
+
class="px-3 py-1 border rounded-lg"
|
228 |
+
>
|
229 |
+
<button @click="getUserSpaces()" class="px-3 py-1 bg-blue-500 text-white rounded-lg">Import Spaces</button>
|
230 |
+
</div>
|
231 |
+
</div>
|
232 |
+
<div class="col-span-2 md:col-span-3 flex items-center gap-14 flex flex-wrap lg-auto lg:ml-auto text-sm">
|
233 |
+
<div class="flex flex-col gap-2">
|
234 |
+
<div class="flex items-center">
|
235 |
+
<input
|
236 |
+
type="text"
|
237 |
+
x-model="searchQuery"
|
238 |
+
@input="searchThemes()"
|
239 |
+
placeholder="Search..."
|
240 |
+
class="px-3 py-1 border rounded-lg"
|
241 |
+
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
</div>
|
243 |
+
</div>
|
244 |
+
<div class="flex gap-2">
|
245 |
+
<span class="md:px-3 py-1 text-gray-800">type</span>
|
246 |
+
<button:class="buttonClass('filter', 'tool')" @click="filterType('tool')">Tools</button>
|
247 |
+
<button:class="buttonClass('filter', 'agent')" @click="filterType('agent')">Agents</button>
|
248 |
+
</div>
|
249 |
+
<div class="flex gap-2">
|
250 |
+
<span class="md:px-3 py-1 text-gray-800">sort by</span>
|
251 |
+
<button:class="buttonClass('sort', 'likes')" @click="sortThemes('likes')">Most Likes</button>
|
252 |
+
<button:class="buttonClass('sort', 'recent')" @click="sortThemes('recent')">Recent</button>
|
253 |
+
</div>
|
254 |
</div>
|
255 |
+
</section>
|
256 |
+
<div class="container px-6 grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2 mx-auto my-8 relative">
|
257 |
+
<template x-for="theme in themes":key="theme.id">
|
258 |
+
<div class="grid-item">
|
259 |
+
<div class="grid-item-header">
|
260 |
+
<h2 class="text-sm font-medium text-white" x-text="theme.id"></h2>
|
261 |
+
</div>
|
262 |
+
<iframe:src="`${theme.subdomain}?_=${new Date().getTime()}`":alt="theme.id" scrolling="no" frameborder="0" loading="lazy"></iframe>
|
263 |
+
<a:href="`https://huggingface.co/spaces/${theme.id}`" target="_blank"></a>
|
264 |
+
</div>
|
265 |
+
</template>
|
266 |
+
</div>
|
267 |
+
<div class="h-12 relative" x-intersect="nextPage" data-iframe-height></div>
|
268 |
</section>
|
269 |
+
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
270 |
</html>
|