feat: close #2303 add custom model name config

This commit is contained in:
Yidadaa
2023-07-09 18:15:52 +08:00
parent 28c457730a
commit 98ac7ee277
5 changed files with 59 additions and 27 deletions

View File

@@ -9,6 +9,10 @@ export function ModelConfigList(props: {
updateConfig: (updater: (config: ModelConfig) => void) => void;
}) {
const config = useAppConfig();
const customModels = config.customModels
.split(",")
.map((m) => ({ name: m, available: true }));
const models = config.models.concat(customModels);
return (
<>
@@ -24,8 +28,8 @@ export function ModelConfigList(props: {
);
}}
>
{config.models.map((v) => (
<option value={v.name} key={v.name} disabled={!v.available}>
{models.map((v, i) => (
<option value={v.name} key={i} disabled={!v.available}>
{v.name}
</option>
))}