victor HF staff commited on
Commit
ec86b59
0 Parent(s):
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ node_modules
getDescriptionsAndSave.mjs ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { promises as fs } from "fs";
2
+ import { textGeneration } from "@huggingface/inference";
3
+ import { AutoTokenizer } from "@xenova/transformers";
4
+
5
+ const HF_TOKEN = "";
6
+
7
+ if (!HF_TOKEN) {
8
+ console.error("Please set the HF_TOKEN environment variable");
9
+ process.exit(1);
10
+ }
11
+
12
+ const buildPrompt = (
13
+ appFile
14
+ ) => `Write a short, imperative description of the provided app's purpose. It MUST ALWAYS be under 80 characters and a single-sentence. You can mention some technology names that you extract from the source code.
15
+ Example descriptions: "Remove background from images.", "Generate captions for images using ViT and GPT2.", "Predict the nutritional value of food based on an image of the food." Only answer with the description and nothing else. DON'T ADD ANY EXPLANATIONS.
16
+ The provided app.py file:
17
+ \`\`\`python
18
+ ${appFile}
19
+ \`\`\``;
20
+
21
+ async function readTrendingSpacesFile() {
22
+ const data = await fs.readFile("trendingSpaces.json", "utf8");
23
+ return JSON.parse(data).filter((space) => space.appFile);
24
+ }
25
+
26
+ const extractTextAfterLastInst = (str) => {
27
+ const match = str.match(/\[\/INST\]([^]*?)$/);
28
+ return match ? match[1].replace(/"/g, "").trim() : "";
29
+ };
30
+
31
+ async function processSpaces() {
32
+ const spaces = await readTrendingSpacesFile();
33
+ const tokenizer = await AutoTokenizer.from_pretrained(
34
+ "mistralai/Mistral-7B-Instruct-v0.1"
35
+ );
36
+
37
+ for (const space of spaces) {
38
+ const chat = [{ role: "user", content: buildPrompt(space.appFile) }];
39
+ try {
40
+ const inputs = await tokenizer.apply_chat_template(chat, {
41
+ tokenize: false,
42
+ });
43
+ const result = await textGeneration({
44
+ model: "mistralai/Mixtral-8x7B-Instruct-v0.1",
45
+ accessToken: HF_TOKEN,
46
+ inputs,
47
+ });
48
+ space.ai_description = extractTextAfterLastInst(result.generated_text);
49
+ console.log(
50
+ `Generated text for space ${space.id}: ${space.ai_description}`
51
+ );
52
+ } catch (error) {
53
+ console.error(`Failed to generate text for space ${space.id}: ${error}`);
54
+ }
55
+ }
56
+
57
+ await saveOutputFile(spaces);
58
+ }
59
+
60
+ async function saveOutputFile(spaces) {
61
+ const filteredSpaces = spaces.filter(
62
+ (space) => space.ai_description && space.ai_description.length <= 120
63
+ );
64
+ const sortedSpaces = filteredSpaces.sort((a, b) => b.likes - a.likes);
65
+ const output = sortedSpaces.map(
66
+ ({ id, emoji, likes, ai_description }) =>
67
+ `${id},${emoji},${likes},"${ai_description}"`
68
+ );
69
+ const csvOutput = `id,emoji,likes,ai_description\n${output.join("\n")}`;
70
+ await fs.writeFile("output.csv", csvOutput);
71
+ console.log("CSV output written to file");
72
+ }
73
+
74
+ // Run the process
75
+ processSpaces().catch(console.error);
package-lock.json ADDED
@@ -0,0 +1,770 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "spaces-descriptions",
3
+ "version": "1.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "spaces-descriptions",
9
+ "version": "1.0.0",
10
+ "license": "ISC",
11
+ "dependencies": {
12
+ "@huggingface/inference": "^2.6.6",
13
+ "@xenova/transformers": "^2.16.1"
14
+ },
15
+ "devDependencies": {}
16
+ },
17
+ "node_modules/@huggingface/inference": {
18
+ "version": "2.6.6",
19
+ "resolved": "https://registry.npmjs.org/@huggingface/inference/-/inference-2.6.6.tgz",
20
+ "integrity": "sha512-5VEsrKj/gQ0BViUHX43VFlgbVH5OR+w6/auTQkvMqnxF3e8yK2AqAVP+zoF4dcm1DEnxUkPGeNYrxOwIUFxjuw==",
21
+ "engines": {
22
+ "node": ">=18"
23
+ }
24
+ },
25
+ "node_modules/@huggingface/jinja": {
26
+ "version": "0.2.2",
27
+ "resolved": "https://registry.npmjs.org/@huggingface/jinja/-/jinja-0.2.2.tgz",
28
+ "integrity": "sha512-/KPde26khDUIPkTGU82jdtTW9UAuvUTumCAbFs/7giR0SxsvZC4hru51PBvpijH6BVkHcROcvZM/lpy5h1jRRA==",
29
+ "engines": {
30
+ "node": ">=18"
31
+ }
32
+ },
33
+ "node_modules/@protobufjs/aspromise": {
34
+ "version": "1.1.2",
35
+ "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz",
36
+ "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ=="
37
+ },
38
+ "node_modules/@protobufjs/base64": {
39
+ "version": "1.1.2",
40
+ "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz",
41
+ "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg=="
42
+ },
43
+ "node_modules/@protobufjs/codegen": {
44
+ "version": "2.0.4",
45
+ "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz",
46
+ "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg=="
47
+ },
48
+ "node_modules/@protobufjs/eventemitter": {
49
+ "version": "1.1.0",
50
+ "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz",
51
+ "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q=="
52
+ },
53
+ "node_modules/@protobufjs/fetch": {
54
+ "version": "1.1.0",
55
+ "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz",
56
+ "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==",
57
+ "dependencies": {
58
+ "@protobufjs/aspromise": "^1.1.1",
59
+ "@protobufjs/inquire": "^1.1.0"
60
+ }
61
+ },
62
+ "node_modules/@protobufjs/float": {
63
+ "version": "1.0.2",
64
+ "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz",
65
+ "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ=="
66
+ },
67
+ "node_modules/@protobufjs/inquire": {
68
+ "version": "1.1.0",
69
+ "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz",
70
+ "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q=="
71
+ },
72
+ "node_modules/@protobufjs/path": {
73
+ "version": "1.1.2",
74
+ "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz",
75
+ "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA=="
76
+ },
77
+ "node_modules/@protobufjs/pool": {
78
+ "version": "1.1.0",
79
+ "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz",
80
+ "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw=="
81
+ },
82
+ "node_modules/@protobufjs/utf8": {
83
+ "version": "1.1.0",
84
+ "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz",
85
+ "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw=="
86
+ },
87
+ "node_modules/@types/long": {
88
+ "version": "4.0.2",
89
+ "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz",
90
+ "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA=="
91
+ },
92
+ "node_modules/@types/node": {
93
+ "version": "20.11.30",
94
+ "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.30.tgz",
95
+ "integrity": "sha512-dHM6ZxwlmuZaRmUPfv1p+KrdD1Dci04FbdEm/9wEMouFqxYoFl5aMkt0VMAUtYRQDyYvD41WJLukhq/ha3YuTw==",
96
+ "dependencies": {
97
+ "undici-types": "~5.26.4"
98
+ }
99
+ },
100
+ "node_modules/@xenova/transformers": {
101
+ "version": "2.16.1",
102
+ "resolved": "https://registry.npmjs.org/@xenova/transformers/-/transformers-2.16.1.tgz",
103
+ "integrity": "sha512-p2ii7v7oC3Se0PC012dn4vt196GCroaN5ngOYJYkfg0/ce8A5frsrnnnktOBJuejG3bW5Hreb7JZ/KxtUaKd8w==",
104
+ "dependencies": {
105
+ "@huggingface/jinja": "^0.2.2",
106
+ "onnxruntime-web": "1.14.0",
107
+ "sharp": "^0.32.0"
108
+ },
109
+ "optionalDependencies": {
110
+ "onnxruntime-node": "1.14.0"
111
+ }
112
+ },
113
+ "node_modules/b4a": {
114
+ "version": "1.6.6",
115
+ "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz",
116
+ "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg=="
117
+ },
118
+ "node_modules/bare-events": {
119
+ "version": "2.2.1",
120
+ "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.2.1.tgz",
121
+ "integrity": "sha512-9GYPpsPFvrWBkelIhOhTWtkeZxVxZOdb3VnFTCzlOo3OjvmTvzLoZFUT8kNFACx0vJej6QPney1Cf9BvzCNE/A==",
122
+ "optional": true
123
+ },
124
+ "node_modules/bare-fs": {
125
+ "version": "2.2.2",
126
+ "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.2.2.tgz",
127
+ "integrity": "sha512-X9IqgvyB0/VA5OZJyb5ZstoN62AzD7YxVGog13kkfYWYqJYcK0kcqLZ6TrmH5qr4/8//ejVcX4x/a0UvaogXmA==",
128
+ "optional": true,
129
+ "dependencies": {
130
+ "bare-events": "^2.0.0",
131
+ "bare-os": "^2.0.0",
132
+ "bare-path": "^2.0.0",
133
+ "streamx": "^2.13.0"
134
+ }
135
+ },
136
+ "node_modules/bare-os": {
137
+ "version": "2.2.1",
138
+ "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.2.1.tgz",
139
+ "integrity": "sha512-OwPyHgBBMkhC29Hl3O4/YfxW9n7mdTr2+SsO29XBWKKJsbgj3mnorDB80r5TiCQgQstgE5ga1qNYrpes6NvX2w==",
140
+ "optional": true
141
+ },
142
+ "node_modules/bare-path": {
143
+ "version": "2.1.0",
144
+ "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.0.tgz",
145
+ "integrity": "sha512-DIIg7ts8bdRKwJRJrUMy/PICEaQZaPGZ26lsSx9MJSwIhSrcdHn7/C8W+XmnG/rKi6BaRcz+JO00CjZteybDtw==",
146
+ "optional": true,
147
+ "dependencies": {
148
+ "bare-os": "^2.1.0"
149
+ }
150
+ },
151
+ "node_modules/base64-js": {
152
+ "version": "1.5.1",
153
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
154
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
155
+ "funding": [
156
+ {
157
+ "type": "github",
158
+ "url": "https://github.com/sponsors/feross"
159
+ },
160
+ {
161
+ "type": "patreon",
162
+ "url": "https://www.patreon.com/feross"
163
+ },
164
+ {
165
+ "type": "consulting",
166
+ "url": "https://feross.org/support"
167
+ }
168
+ ]
169
+ },
170
+ "node_modules/bl": {
171
+ "version": "4.1.0",
172
+ "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz",
173
+ "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==",
174
+ "dependencies": {
175
+ "buffer": "^5.5.0",
176
+ "inherits": "^2.0.4",
177
+ "readable-stream": "^3.4.0"
178
+ }
179
+ },
180
+ "node_modules/buffer": {
181
+ "version": "5.7.1",
182
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz",
183
+ "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==",
184
+ "funding": [
185
+ {
186
+ "type": "github",
187
+ "url": "https://github.com/sponsors/feross"
188
+ },
189
+ {
190
+ "type": "patreon",
191
+ "url": "https://www.patreon.com/feross"
192
+ },
193
+ {
194
+ "type": "consulting",
195
+ "url": "https://feross.org/support"
196
+ }
197
+ ],
198
+ "dependencies": {
199
+ "base64-js": "^1.3.1",
200
+ "ieee754": "^1.1.13"
201
+ }
202
+ },
203
+ "node_modules/chownr": {
204
+ "version": "1.1.4",
205
+ "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz",
206
+ "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg=="
207
+ },
208
+ "node_modules/color": {
209
+ "version": "4.2.3",
210
+ "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz",
211
+ "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==",
212
+ "dependencies": {
213
+ "color-convert": "^2.0.1",
214
+ "color-string": "^1.9.0"
215
+ },
216
+ "engines": {
217
+ "node": ">=12.5.0"
218
+ }
219
+ },
220
+ "node_modules/color-convert": {
221
+ "version": "2.0.1",
222
+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
223
+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
224
+ "dependencies": {
225
+ "color-name": "~1.1.4"
226
+ },
227
+ "engines": {
228
+ "node": ">=7.0.0"
229
+ }
230
+ },
231
+ "node_modules/color-name": {
232
+ "version": "1.1.4",
233
+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
234
+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
235
+ },
236
+ "node_modules/color-string": {
237
+ "version": "1.9.1",
238
+ "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz",
239
+ "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==",
240
+ "dependencies": {
241
+ "color-name": "^1.0.0",
242
+ "simple-swizzle": "^0.2.2"
243
+ }
244
+ },
245
+ "node_modules/decompress-response": {
246
+ "version": "6.0.0",
247
+ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz",
248
+ "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==",
249
+ "dependencies": {
250
+ "mimic-response": "^3.1.0"
251
+ },
252
+ "engines": {
253
+ "node": ">=10"
254
+ },
255
+ "funding": {
256
+ "url": "https://github.com/sponsors/sindresorhus"
257
+ }
258
+ },
259
+ "node_modules/deep-extend": {
260
+ "version": "0.6.0",
261
+ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz",
262
+ "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
263
+ "engines": {
264
+ "node": ">=4.0.0"
265
+ }
266
+ },
267
+ "node_modules/detect-libc": {
268
+ "version": "2.0.3",
269
+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz",
270
+ "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==",
271
+ "engines": {
272
+ "node": ">=8"
273
+ }
274
+ },
275
+ "node_modules/end-of-stream": {
276
+ "version": "1.4.4",
277
+ "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
278
+ "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
279
+ "dependencies": {
280
+ "once": "^1.4.0"
281
+ }
282
+ },
283
+ "node_modules/expand-template": {
284
+ "version": "2.0.3",
285
+ "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz",
286
+ "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==",
287
+ "engines": {
288
+ "node": ">=6"
289
+ }
290
+ },
291
+ "node_modules/fast-fifo": {
292
+ "version": "1.3.2",
293
+ "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
294
+ "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ=="
295
+ },
296
+ "node_modules/flatbuffers": {
297
+ "version": "1.12.0",
298
+ "resolved": "https://registry.npmjs.org/flatbuffers/-/flatbuffers-1.12.0.tgz",
299
+ "integrity": "sha512-c7CZADjRcl6j0PlvFy0ZqXQ67qSEZfrVPynmnL+2zPc+NtMvrF8Y0QceMo7QqnSPc7+uWjUIAbvCQ5WIKlMVdQ=="
300
+ },
301
+ "node_modules/fs-constants": {
302
+ "version": "1.0.0",
303
+ "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
304
+ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
305
+ },
306
+ "node_modules/github-from-package": {
307
+ "version": "0.0.0",
308
+ "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz",
309
+ "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw=="
310
+ },
311
+ "node_modules/guid-typescript": {
312
+ "version": "1.0.9",
313
+ "resolved": "https://registry.npmjs.org/guid-typescript/-/guid-typescript-1.0.9.tgz",
314
+ "integrity": "sha512-Y8T4vYhEfwJOTbouREvG+3XDsjr8E3kIr7uf+JZ0BYloFsttiHU0WfvANVsR7TxNUJa/WpCnw/Ino/p+DeBhBQ=="
315
+ },
316
+ "node_modules/ieee754": {
317
+ "version": "1.2.1",
318
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
319
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
320
+ "funding": [
321
+ {
322
+ "type": "github",
323
+ "url": "https://github.com/sponsors/feross"
324
+ },
325
+ {
326
+ "type": "patreon",
327
+ "url": "https://www.patreon.com/feross"
328
+ },
329
+ {
330
+ "type": "consulting",
331
+ "url": "https://feross.org/support"
332
+ }
333
+ ]
334
+ },
335
+ "node_modules/inherits": {
336
+ "version": "2.0.4",
337
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
338
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
339
+ },
340
+ "node_modules/ini": {
341
+ "version": "1.3.8",
342
+ "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz",
343
+ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew=="
344
+ },
345
+ "node_modules/is-arrayish": {
346
+ "version": "0.3.2",
347
+ "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz",
348
+ "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ=="
349
+ },
350
+ "node_modules/long": {
351
+ "version": "4.0.0",
352
+ "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz",
353
+ "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA=="
354
+ },
355
+ "node_modules/lru-cache": {
356
+ "version": "6.0.0",
357
+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",
358
+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",
359
+ "dependencies": {
360
+ "yallist": "^4.0.0"
361
+ },
362
+ "engines": {
363
+ "node": ">=10"
364
+ }
365
+ },
366
+ "node_modules/mimic-response": {
367
+ "version": "3.1.0",
368
+ "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz",
369
+ "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==",
370
+ "engines": {
371
+ "node": ">=10"
372
+ },
373
+ "funding": {
374
+ "url": "https://github.com/sponsors/sindresorhus"
375
+ }
376
+ },
377
+ "node_modules/minimist": {
378
+ "version": "1.2.8",
379
+ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
380
+ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
381
+ "funding": {
382
+ "url": "https://github.com/sponsors/ljharb"
383
+ }
384
+ },
385
+ "node_modules/mkdirp-classic": {
386
+ "version": "0.5.3",
387
+ "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
388
+ "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A=="
389
+ },
390
+ "node_modules/napi-build-utils": {
391
+ "version": "1.0.2",
392
+ "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz",
393
+ "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg=="
394
+ },
395
+ "node_modules/node-abi": {
396
+ "version": "3.56.0",
397
+ "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.56.0.tgz",
398
+ "integrity": "sha512-fZjdhDOeRcaS+rcpve7XuwHBmktS1nS1gzgghwKUQQ8nTy2FdSDr6ZT8k6YhvlJeHmmQMYiT/IH9hfco5zeW2Q==",
399
+ "dependencies": {
400
+ "semver": "^7.3.5"
401
+ },
402
+ "engines": {
403
+ "node": ">=10"
404
+ }
405
+ },
406
+ "node_modules/node-addon-api": {
407
+ "version": "6.1.0",
408
+ "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-6.1.0.tgz",
409
+ "integrity": "sha512-+eawOlIgy680F0kBzPUNFhMZGtJ1YmqM6l4+Crf4IkImjYrO/mqPwRMh352g23uIaQKFItcQ64I7KMaJxHgAVA=="
410
+ },
411
+ "node_modules/once": {
412
+ "version": "1.4.0",
413
+ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
414
+ "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
415
+ "dependencies": {
416
+ "wrappy": "1"
417
+ }
418
+ },
419
+ "node_modules/onnx-proto": {
420
+ "version": "4.0.4",
421
+ "resolved": "https://registry.npmjs.org/onnx-proto/-/onnx-proto-4.0.4.tgz",
422
+ "integrity": "sha512-aldMOB3HRoo6q/phyB6QRQxSt895HNNw82BNyZ2CMh4bjeKv7g/c+VpAFtJuEMVfYLMbRx61hbuqnKceLeDcDA==",
423
+ "dependencies": {
424
+ "protobufjs": "^6.8.8"
425
+ }
426
+ },
427
+ "node_modules/onnxruntime-common": {
428
+ "version": "1.14.0",
429
+ "resolved": "https://registry.npmjs.org/onnxruntime-common/-/onnxruntime-common-1.14.0.tgz",
430
+ "integrity": "sha512-3LJpegM2iMNRX2wUmtYfeX/ytfOzNwAWKSq1HbRrKc9+uqG/FsEA0bbKZl1btQeZaXhC26l44NWpNUeXPII7Ew=="
431
+ },
432
+ "node_modules/onnxruntime-node": {
433
+ "version": "1.14.0",
434
+ "resolved": "https://registry.npmjs.org/onnxruntime-node/-/onnxruntime-node-1.14.0.tgz",
435
+ "integrity": "sha512-5ba7TWomIV/9b6NH/1x/8QEeowsb+jBEvFzU6z0T4mNsFwdPqXeFUM7uxC6QeSRkEbWu3qEB0VMjrvzN/0S9+w==",
436
+ "optional": true,
437
+ "os": [
438
+ "win32",
439
+ "darwin",
440
+ "linux"
441
+ ],
442
+ "dependencies": {
443
+ "onnxruntime-common": "~1.14.0"
444
+ }
445
+ },
446
+ "node_modules/onnxruntime-web": {
447
+ "version": "1.14.0",
448
+ "resolved": "https://registry.npmjs.org/onnxruntime-web/-/onnxruntime-web-1.14.0.tgz",
449
+ "integrity": "sha512-Kcqf43UMfW8mCydVGcX9OMXI2VN17c0p6XvR7IPSZzBf/6lteBzXHvcEVWDPmCKuGombl997HgLqj91F11DzXw==",
450
+ "dependencies": {
451
+ "flatbuffers": "^1.12.0",
452
+ "guid-typescript": "^1.0.9",
453
+ "long": "^4.0.0",
454
+ "onnx-proto": "^4.0.4",
455
+ "onnxruntime-common": "~1.14.0",
456
+ "platform": "^1.3.6"
457
+ }
458
+ },
459
+ "node_modules/platform": {
460
+ "version": "1.3.6",
461
+ "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz",
462
+ "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg=="
463
+ },
464
+ "node_modules/prebuild-install": {
465
+ "version": "7.1.2",
466
+ "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz",
467
+ "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==",
468
+ "dependencies": {
469
+ "detect-libc": "^2.0.0",
470
+ "expand-template": "^2.0.3",
471
+ "github-from-package": "0.0.0",
472
+ "minimist": "^1.2.3",
473
+ "mkdirp-classic": "^0.5.3",
474
+ "napi-build-utils": "^1.0.1",
475
+ "node-abi": "^3.3.0",
476
+ "pump": "^3.0.0",
477
+ "rc": "^1.2.7",
478
+ "simple-get": "^4.0.0",
479
+ "tar-fs": "^2.0.0",
480
+ "tunnel-agent": "^0.6.0"
481
+ },
482
+ "bin": {
483
+ "prebuild-install": "bin.js"
484
+ },
485
+ "engines": {
486
+ "node": ">=10"
487
+ }
488
+ },
489
+ "node_modules/prebuild-install/node_modules/tar-fs": {
490
+ "version": "2.1.1",
491
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz",
492
+ "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==",
493
+ "dependencies": {
494
+ "chownr": "^1.1.1",
495
+ "mkdirp-classic": "^0.5.2",
496
+ "pump": "^3.0.0",
497
+ "tar-stream": "^2.1.4"
498
+ }
499
+ },
500
+ "node_modules/prebuild-install/node_modules/tar-stream": {
501
+ "version": "2.2.0",
502
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz",
503
+ "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==",
504
+ "dependencies": {
505
+ "bl": "^4.0.3",
506
+ "end-of-stream": "^1.4.1",
507
+ "fs-constants": "^1.0.0",
508
+ "inherits": "^2.0.3",
509
+ "readable-stream": "^3.1.1"
510
+ },
511
+ "engines": {
512
+ "node": ">=6"
513
+ }
514
+ },
515
+ "node_modules/protobufjs": {
516
+ "version": "6.11.4",
517
+ "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-6.11.4.tgz",
518
+ "integrity": "sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==",
519
+ "hasInstallScript": true,
520
+ "dependencies": {
521
+ "@protobufjs/aspromise": "^1.1.2",
522
+ "@protobufjs/base64": "^1.1.2",
523
+ "@protobufjs/codegen": "^2.0.4",
524
+ "@protobufjs/eventemitter": "^1.1.0",
525
+ "@protobufjs/fetch": "^1.1.0",
526
+ "@protobufjs/float": "^1.0.2",
527
+ "@protobufjs/inquire": "^1.1.0",
528
+ "@protobufjs/path": "^1.1.2",
529
+ "@protobufjs/pool": "^1.1.0",
530
+ "@protobufjs/utf8": "^1.1.0",
531
+ "@types/long": "^4.0.1",
532
+ "@types/node": ">=13.7.0",
533
+ "long": "^4.0.0"
534
+ },
535
+ "bin": {
536
+ "pbjs": "bin/pbjs",
537
+ "pbts": "bin/pbts"
538
+ }
539
+ },
540
+ "node_modules/pump": {
541
+ "version": "3.0.0",
542
+ "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
543
+ "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
544
+ "dependencies": {
545
+ "end-of-stream": "^1.1.0",
546
+ "once": "^1.3.1"
547
+ }
548
+ },
549
+ "node_modules/queue-tick": {
550
+ "version": "1.0.1",
551
+ "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz",
552
+ "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag=="
553
+ },
554
+ "node_modules/rc": {
555
+ "version": "1.2.8",
556
+ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
557
+ "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
558
+ "dependencies": {
559
+ "deep-extend": "^0.6.0",
560
+ "ini": "~1.3.0",
561
+ "minimist": "^1.2.0",
562
+ "strip-json-comments": "~2.0.1"
563
+ },
564
+ "bin": {
565
+ "rc": "cli.js"
566
+ }
567
+ },
568
+ "node_modules/readable-stream": {
569
+ "version": "3.6.2",
570
+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
571
+ "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
572
+ "dependencies": {
573
+ "inherits": "^2.0.3",
574
+ "string_decoder": "^1.1.1",
575
+ "util-deprecate": "^1.0.1"
576
+ },
577
+ "engines": {
578
+ "node": ">= 6"
579
+ }
580
+ },
581
+ "node_modules/safe-buffer": {
582
+ "version": "5.2.1",
583
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
584
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
585
+ "funding": [
586
+ {
587
+ "type": "github",
588
+ "url": "https://github.com/sponsors/feross"
589
+ },
590
+ {
591
+ "type": "patreon",
592
+ "url": "https://www.patreon.com/feross"
593
+ },
594
+ {
595
+ "type": "consulting",
596
+ "url": "https://feross.org/support"
597
+ }
598
+ ]
599
+ },
600
+ "node_modules/semver": {
601
+ "version": "7.6.0",
602
+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.0.tgz",
603
+ "integrity": "sha512-EnwXhrlwXMk9gKu5/flx5sv/an57AkRplG3hTK68W7FRDN+k+OWBj65M7719OkA82XLBxrcX0KSHj+X5COhOVg==",
604
+ "dependencies": {
605
+ "lru-cache": "^6.0.0"
606
+ },
607
+ "bin": {
608
+ "semver": "bin/semver.js"
609
+ },
610
+ "engines": {
611
+ "node": ">=10"
612
+ }
613
+ },
614
+ "node_modules/sharp": {
615
+ "version": "0.32.6",
616
+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.32.6.tgz",
617
+ "integrity": "sha512-KyLTWwgcR9Oe4d9HwCwNM2l7+J0dUQwn/yf7S0EnTtb0eVS4RxO0eUSvxPtzT4F3SY+C4K6fqdv/DO27sJ/v/w==",
618
+ "hasInstallScript": true,
619
+ "dependencies": {
620
+ "color": "^4.2.3",
621
+ "detect-libc": "^2.0.2",
622
+ "node-addon-api": "^6.1.0",
623
+ "prebuild-install": "^7.1.1",
624
+ "semver": "^7.5.4",
625
+ "simple-get": "^4.0.1",
626
+ "tar-fs": "^3.0.4",
627
+ "tunnel-agent": "^0.6.0"
628
+ },
629
+ "engines": {
630
+ "node": ">=14.15.0"
631
+ },
632
+ "funding": {
633
+ "url": "https://opencollective.com/libvips"
634
+ }
635
+ },
636
+ "node_modules/simple-concat": {
637
+ "version": "1.0.1",
638
+ "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
639
+ "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
640
+ "funding": [
641
+ {
642
+ "type": "github",
643
+ "url": "https://github.com/sponsors/feross"
644
+ },
645
+ {
646
+ "type": "patreon",
647
+ "url": "https://www.patreon.com/feross"
648
+ },
649
+ {
650
+ "type": "consulting",
651
+ "url": "https://feross.org/support"
652
+ }
653
+ ]
654
+ },
655
+ "node_modules/simple-get": {
656
+ "version": "4.0.1",
657
+ "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz",
658
+ "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==",
659
+ "funding": [
660
+ {
661
+ "type": "github",
662
+ "url": "https://github.com/sponsors/feross"
663
+ },
664
+ {
665
+ "type": "patreon",
666
+ "url": "https://www.patreon.com/feross"
667
+ },
668
+ {
669
+ "type": "consulting",
670
+ "url": "https://feross.org/support"
671
+ }
672
+ ],
673
+ "dependencies": {
674
+ "decompress-response": "^6.0.0",
675
+ "once": "^1.3.1",
676
+ "simple-concat": "^1.0.0"
677
+ }
678
+ },
679
+ "node_modules/simple-swizzle": {
680
+ "version": "0.2.2",
681
+ "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz",
682
+ "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==",
683
+ "dependencies": {
684
+ "is-arrayish": "^0.3.1"
685
+ }
686
+ },
687
+ "node_modules/streamx": {
688
+ "version": "2.16.1",
689
+ "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.1.tgz",
690
+ "integrity": "sha512-m9QYj6WygWyWa3H1YY69amr4nVgy61xfjys7xO7kviL5rfIEc2naf+ewFiOA+aEJD7y0JO3h2GoiUv4TDwEGzQ==",
691
+ "dependencies": {
692
+ "fast-fifo": "^1.1.0",
693
+ "queue-tick": "^1.0.1"
694
+ },
695
+ "optionalDependencies": {
696
+ "bare-events": "^2.2.0"
697
+ }
698
+ },
699
+ "node_modules/string_decoder": {
700
+ "version": "1.3.0",
701
+ "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
702
+ "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
703
+ "dependencies": {
704
+ "safe-buffer": "~5.2.0"
705
+ }
706
+ },
707
+ "node_modules/strip-json-comments": {
708
+ "version": "2.0.1",
709
+ "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
710
+ "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
711
+ "engines": {
712
+ "node": ">=0.10.0"
713
+ }
714
+ },
715
+ "node_modules/tar-fs": {
716
+ "version": "3.0.5",
717
+ "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.5.tgz",
718
+ "integrity": "sha512-JOgGAmZyMgbqpLwct7ZV8VzkEB6pxXFBVErLtb+XCOqzc6w1xiWKI9GVd6bwk68EX7eJ4DWmfXVmq8K2ziZTGg==",
719
+ "dependencies": {
720
+ "pump": "^3.0.0",
721
+ "tar-stream": "^3.1.5"
722
+ },
723
+ "optionalDependencies": {
724
+ "bare-fs": "^2.1.1",
725
+ "bare-path": "^2.1.0"
726
+ }
727
+ },
728
+ "node_modules/tar-stream": {
729
+ "version": "3.1.7",
730
+ "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz",
731
+ "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==",
732
+ "dependencies": {
733
+ "b4a": "^1.6.4",
734
+ "fast-fifo": "^1.2.0",
735
+ "streamx": "^2.15.0"
736
+ }
737
+ },
738
+ "node_modules/tunnel-agent": {
739
+ "version": "0.6.0",
740
+ "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
741
+ "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
742
+ "dependencies": {
743
+ "safe-buffer": "^5.0.1"
744
+ },
745
+ "engines": {
746
+ "node": "*"
747
+ }
748
+ },
749
+ "node_modules/undici-types": {
750
+ "version": "5.26.5",
751
+ "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
752
+ "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="
753
+ },
754
+ "node_modules/util-deprecate": {
755
+ "version": "1.0.2",
756
+ "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
757
+ "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw=="
758
+ },
759
+ "node_modules/wrappy": {
760
+ "version": "1.0.2",
761
+ "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
762
+ "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="
763
+ },
764
+ "node_modules/yallist": {
765
+ "version": "4.0.0",
766
+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",
767
+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="
768
+ }
769
+ }
770
+ }
package.json ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "dependencies": {
3
+ "@huggingface/inference": "^2.6.6",
4
+ "@xenova/transformers": "^2.16.1"
5
+ },
6
+ "name": "spaces-descriptions",
7
+ "version": "1.0.0",
8
+ "main": "index.js",
9
+ "devDependencies": {},
10
+ "scripts": {
11
+ "fetch-trending": "node saveTrendingToJSON.mjs ",
12
+ "get-descriptions": "node getDescriptionsAndSave.mjs"
13
+ },
14
+ "author": "",
15
+ "license": "ISC",
16
+ "description": ""
17
+ }
saveTrendingToJSON.mjs ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import { promises as fs } from "fs";
2
+
3
+ const fetchJson = async (url) => {
4
+ const response = await fetch(url);
5
+ if (!response.ok) throw new Error("Network response was not ok");
6
+ return response.json();
7
+ };
8
+
9
+ const fetchAllPages = async () => {
10
+ const pageNumbers = Array.from({ length: 2 }, (_, i) => i);
11
+ const urls = pageNumbers.map((pageNumber) => {
12
+ const url = new URL("https://huggingface.co/spaces-json");
13
+ url.search = new URLSearchParams({
14
+ p: pageNumber,
15
+ sort: "trending",
16
+ }).toString();
17
+ return url;
18
+ });
19
+ const jsonResponses = await Promise.all(urls.map(fetchJson));
20
+ return jsonResponses.flatMap((json) => json.spaces);
21
+ };
22
+
23
+ const addAppFileToSpaces = async (spaces) => {
24
+ return Promise.all(
25
+ spaces.map(async (space) => {
26
+ try {
27
+ const url = `https://huggingface.co/spaces/${space.id}/resolve/main/app.py`;
28
+ const response = await fetch(url);
29
+ if (response.ok) {
30
+ console.log(`Fetched appFile for space ${space.id}`);
31
+ const appFile = await response.text();
32
+ return { ...space, appFile };
33
+ }
34
+ } catch (error) {
35
+ console.error(
36
+ `Failed to fetch appFile for space ${space.id}: ${error}`
37
+ );
38
+ }
39
+ return space;
40
+ })
41
+ );
42
+ };
43
+
44
+ const saveAllTrendingSpaces = async () => {
45
+ try {
46
+ const spaces = await fetchAllPages();
47
+ const spacesWithAppFile = await addAppFileToSpaces(spaces);
48
+ const publicSpaces = spacesWithAppFile.filter(
49
+ (space) => space.private === false
50
+ );
51
+ await fs.writeFile(
52
+ "trendingSpaces.json",
53
+ JSON.stringify(publicSpaces, null, 2)
54
+ );
55
+ console.log("Data written to file");
56
+ } catch (error) {
57
+ console.error(`An error occurred: ${error}`);
58
+ }
59
+ };
60
+
61
+ saveAllTrendingSpaces();