Spaces:
Running
Running
update scrap post slug
Browse files
src/routes/api/scrap-models/[slug]/+server.ts
CHANGED
|
@@ -54,6 +54,8 @@ export async function POST({ request, params }) {
|
|
| 54 |
}
|
| 55 |
}
|
| 56 |
|
|
|
|
|
|
|
| 57 |
await prisma.model.create({
|
| 58 |
data: {
|
| 59 |
id: model.id,
|
|
@@ -62,6 +64,10 @@ export async function POST({ request, params }) {
|
|
| 62 |
downloads: model.downloads,
|
| 63 |
isPublic: true,
|
| 64 |
instance_prompt: model?.cardData?.instance_prompt,
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
}
|
| 66 |
}).catch(() => {})
|
| 67 |
|
|
|
|
| 54 |
}
|
| 55 |
}
|
| 56 |
|
| 57 |
+
const base_model = model?.tags?.find((tag: string) => tag.startsWith("base_model:"))?.split(":")[1] ?? null
|
| 58 |
+
|
| 59 |
await prisma.model.create({
|
| 60 |
data: {
|
| 61 |
id: model.id,
|
|
|
|
| 64 |
downloads: model.downloads,
|
| 65 |
isPublic: true,
|
| 66 |
instance_prompt: model?.cardData?.instance_prompt,
|
| 67 |
+
...(base_model ? {
|
| 68 |
+
base_model: base_model
|
| 69 |
+
} : {}
|
| 70 |
+
)
|
| 71 |
}
|
| 72 |
}).catch(() => {})
|
| 73 |
|