Fix/speech to text button (#947)

This commit is contained in:
zxhlyh
2023-08-22 14:55:20 +08:00
committed by GitHub
parent a3aba7a9aa
commit b185a70c21
8 changed files with 35 additions and 246 deletions

View File

@@ -61,11 +61,15 @@ type DeleteModel = {
const ModelPage = () => {
const { t } = useTranslation()
const { updateModelList } = useProviderContext()
const {
updateModelList,
embeddingsDefaultModel,
mutateEmbeddingsDefaultModel,
speech2textDefaultModel,
mutateSpeech2textDefaultModel,
} = useProviderContext()
const { data: providers, mutate: mutateProviders } = useSWR('/workspaces/current/model-providers', fetchModelProviders)
const { data: textGenerationDefaultModel, mutate: mutateTextGenerationDefaultModel } = useSWR('/workspaces/current/default-model?model_type=text-generation', fetchDefaultModal)
const { data: embeddingsDefaultModel, mutate: mutateEmbeddingsDefaultModel } = useSWR('/workspaces/current/default-model?model_type=embeddings', fetchDefaultModal)
const { data: speech2textDefaultModel, mutate: mutateSpeech2textDefaultModel } = useSWR('/workspaces/current/default-model?model_type=speech2text', fetchDefaultModal)
const [showMoreModel, setShowMoreModel] = useState(false)
const [showModal, setShowModal] = useState(false)
const { notify } = useToastContext()