Spaces:
Build error
Build error
Pass stop sequences properly to TGI (#499)
Browse files* Pass stop sequences properly to TGI
* fix types
- src/lib/server/models.ts +2 -1
src/lib/server/models.ts
CHANGED
|
@@ -111,6 +111,7 @@ export const models = await Promise.all(
|
|
| 111 |
id: m.id || m.name,
|
| 112 |
displayName: m.displayName || m.name,
|
| 113 |
preprompt: m.prepromptUrl ? await fetch(m.prepromptUrl).then((r) => r.text()) : m.preprompt,
|
|
|
|
| 114 |
}))
|
| 115 |
);
|
| 116 |
|
|
@@ -128,7 +129,7 @@ export const oldModels = OLD_MODELS
|
|
| 128 |
.map((m) => ({ ...m, id: m.id || m.name, displayName: m.displayName || m.name }))
|
| 129 |
: [];
|
| 130 |
|
| 131 |
-
export type BackendModel = Optional<(typeof models)[0], "preprompt">;
|
| 132 |
export type Endpoint = z.infer<typeof endpoint>;
|
| 133 |
|
| 134 |
export const defaultModel = models[0];
|
|
|
|
| 111 |
id: m.id || m.name,
|
| 112 |
displayName: m.displayName || m.name,
|
| 113 |
preprompt: m.prepromptUrl ? await fetch(m.prepromptUrl).then((r) => r.text()) : m.preprompt,
|
| 114 |
+
parameters: { ...m.parameters, stop_sequences: m.parameters?.stop },
|
| 115 |
}))
|
| 116 |
);
|
| 117 |
|
|
|
|
| 129 |
.map((m) => ({ ...m, id: m.id || m.name, displayName: m.displayName || m.name }))
|
| 130 |
: [];
|
| 131 |
|
| 132 |
+
export type BackendModel = Optional<(typeof models)[0], "preprompt" | "parameters">;
|
| 133 |
export type Endpoint = z.infer<typeof endpoint>;
|
| 134 |
|
| 135 |
export const defaultModel = models[0];
|