Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
fix bulk create
Browse files
src/routes/api/bulk-create-models/+server.ts
CHANGED
@@ -16,7 +16,11 @@ export async function POST({ request }) {
|
|
16 |
const { models } = await request.json();
|
17 |
|
18 |
const cards = await Promise.all(models.map(async (model: Record<string, string>) => {
|
19 |
-
const res = await fetch(`https://huggingface.co/api/models/${model.
|
|
|
|
|
|
|
|
|
20 |
const data = await res.json();
|
21 |
const mergedData = {
|
22 |
image: model.image,
|
|
|
16 |
const { models } = await request.json();
|
17 |
|
18 |
const cards = await Promise.all(models.map(async (model: Record<string, string>) => {
|
19 |
+
const res = await fetch(`https://huggingface.co/api/models/${model.repo}`, {
|
20 |
+
headers: {
|
21 |
+
"Authorization": `Bearer ${env.SECRET_HF_TOKEN}`
|
22 |
+
}
|
23 |
+
})
|
24 |
const data = await res.json();
|
25 |
const mergedData = {
|
26 |
image: model.image,
|