Merge pull request #2253 from Yidadaa/bugfix-0704

feat: close #2192 use /list/models to get model ids
This commit is contained in:
Yifei Zhang
2023-07-04 23:21:32 +08:00
committed by GitHub
14 changed files with 222 additions and 124 deletions

View File

@@ -1,4 +1,4 @@
import { ALL_MODELS, ModalConfigValidator, ModelConfig } from "../store";
import { ModalConfigValidator, ModelConfig, useAppConfig } from "../store";
import Locale from "../locales";
import { InputRange } from "./input-range";
@@ -8,6 +8,8 @@ export function ModelConfigList(props: {
modelConfig: ModelConfig;
updateConfig: (updater: (config: ModelConfig) => void) => void;
}) {
const config = useAppConfig();
return (
<>
<ListItem title={Locale.Settings.Model}>
@@ -22,7 +24,7 @@ export function ModelConfigList(props: {
);
}}
>
{ALL_MODELS.map((v) => (
{config.models.map((v) => (
<option value={v.name} key={v.name} disabled={!v.available}>
{v.name}
</option>