fix: voice list do not be shown

This commit is contained in:
jialin
2025-04-02 21:11:50 +08:00
parent afacd2a8a0
commit dd8059693d
4 changed files with 9 additions and 9 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ export default {
'models.form.files': '文件', 'models.form.files': '文件',
'models.table.status': '状态', 'models.table.status': '状态',
'models.form.submit.anyway': '仍然提交', 'models.form.submit.anyway': '仍然提交',
'models.form.evaluating': '评估模型兼容性', 'models.form.evaluating': '评估模型兼容性中...',
'models.form.incompatible': '检测到不兼容', 'models.form.incompatible': '检测到不兼容',
'models.form.restart.onerror': '错误时重启', 'models.form.restart.onerror': '错误时重启',
'models.form.restart.onerror.tips': '当发生错误时,将自动尝试恢复', 'models.form.restart.onerror.tips': '当发生错误时,将自动尝试恢复',
@@ -496,7 +496,8 @@ const AddModal: React.FC<AddModalProps> = (props) => {
sizeOptions: sizeOptions, sizeOptions: sizeOptions,
quantizationOptions: quantizationOptions, quantizationOptions: quantizationOptions,
onSizeChange: handleOnSizeChange, onSizeChange: handleOnSizeChange,
onQuantizationChange: handleOnQuantizationChange onQuantizationChange: handleOnQuantizationChange,
onValuesChange: handleOnValuesChange
}} }}
> >
<FormWrapper> <FormWrapper>
+1 -1
View File
@@ -244,7 +244,7 @@ export const useCheckCompatibility = () => {
show: true, show: true,
title: '', title: '',
type: 'transition', type: 'transition',
message: intl.formatMessage({ id: 'models.form.check.params' }) message: intl.formatMessage({ id: 'models.form.evaluating' })
}); });
const evalution = await evaluationsModelSpec( const evalution = await evaluationsModelSpec(
{ {
@@ -10,7 +10,7 @@ import { Form, Spin } from 'antd';
import classNames from 'classnames'; import classNames from 'classnames';
import _ from 'lodash'; import _ from 'lodash';
import 'overlayscrollbars/overlayscrollbars.css'; import 'overlayscrollbars/overlayscrollbars.css';
import { import React, {
forwardRef, forwardRef,
useCallback, useCallback,
useEffect, useEffect,
@@ -248,7 +248,6 @@ const GroundTTS: React.FC<MessageProps> = forwardRef((props, ref) => {
}); });
const newList = sortVoiceList(locale, list); const newList = sortVoiceList(locale, list);
setVoiceList(newList); setVoiceList(newList);
setParams((pre: any) => { setParams((pre: any) => {
return { return {
@@ -269,14 +268,14 @@ const GroundTTS: React.FC<MessageProps> = forwardRef((props, ref) => {
setParams(allValues); setParams(allValues);
} }
}, },
[] [handleSelectModel]
); );
useEffect(() => { useEffect(() => {
if (paramsRef.current) { if (paramsRef.current) {
innitializeParams(paramsRef.current); innitializeParams(paramsRef.current);
} }
}, [paramsRef.current, innitializeParams]); }, [innitializeParams]);
const handleOnCheckChange = (e: any) => { const handleOnCheckChange = (e: any) => {
checkvalueRef.current = e.target.checked; checkvalueRef.current = e.target.checked;
@@ -301,10 +300,10 @@ const GroundTTS: React.FC<MessageProps> = forwardRef((props, ref) => {
}, [paramsConfig, intl, voiceList]); }, [paramsConfig, intl, voiceList]);
useEffect(() => { useEffect(() => {
if (defaultModel) { if (defaultModel && modelList.length) {
handleSelectModel(defaultModel); handleSelectModel(defaultModel);
} }
}, [defaultModel]); }, [defaultModel, modelList.length]);
useEffect(() => { useEffect(() => {
if (scroller.current) { if (scroller.current) {