|
1 | 1 | import { models } from "$lib/server/models";
|
2 | 2 |
|
3 | 3 | export async function GET() {
|
4 |
| - const res = models.map((model) => ({ |
5 |
| - id: model.id, |
6 |
| - name: model.name, |
7 |
| - websiteUrl: model.websiteUrl, |
8 |
| - modelUrl: model.modelUrl, |
9 |
| - tokenizer: model.tokenizer, |
10 |
| - datasetName: model.datasetName, |
11 |
| - datasetUrl: model.datasetUrl, |
12 |
| - displayName: model.displayName, |
13 |
| - description: model.description ?? "", |
14 |
| - logoUrl: model.logoUrl, |
15 |
| - promptExamples: model.promptExamples ?? [], |
16 |
| - preprompt: model.preprompt, |
17 |
| - multimodal: model.multimodal, |
18 |
| - unlisted: model.unlisted, |
19 |
| - })); |
| 4 | + const res = models |
| 5 | + .filter((m) => m.unlisted == false) |
| 6 | + .map((model) => ({ |
| 7 | + id: model.id, |
| 8 | + name: model.name, |
| 9 | + websiteUrl: model.websiteUrl ?? "https://huggingface.co", |
| 10 | + modelUrl: model.modelUrl ?? "https://huggingface.co", |
| 11 | + tokenizer: model.tokenizer, |
| 12 | + datasetName: model.datasetName, |
| 13 | + datasetUrl: model.datasetUrl, |
| 14 | + displayName: model.displayName, |
| 15 | + description: model.description ?? "", |
| 16 | + logoUrl: model.logoUrl, |
| 17 | + promptExamples: model.promptExamples ?? [], |
| 18 | + preprompt: model.preprompt ?? "", |
| 19 | + multimodal: model.multimodal ?? false, |
| 20 | + unlisted: model.unlisted ?? false, |
| 21 | + })); |
20 | 22 | return Response.json(res);
|
21 | 23 | }
|
0 commit comments