fix: audio set progress error

This commit is contained in:
jialin
2024-12-03 16:17:54 +08:00
parent 687dabc777
commit 83294abaf0
8 changed files with 135 additions and 32 deletions
@@ -256,6 +256,9 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
<div>
{intl.formatMessage({ id: 'models.search.vllm.tips' })}
</div>
<div>
{intl.formatMessage({ id: 'models.search.voxbox.tips' })}
</div>
</div>
}
>
+14 -3
View File
@@ -52,7 +52,17 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
autoplay: boolean;
audioUrl: string;
}[]
>([]);
>([
{
input: '',
voice: '',
format: '',
speed: 0,
uid: 0,
autoplay: false,
audioUrl: ''
}
]);
const locale = getLocale();
const intl = useIntl();
const [searchParams] = useSearchParams();
@@ -140,6 +150,7 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
setMessageId();
setTokenResult(null);
setCurrentPrompt(current?.content || '');
setMessageList([]);
controllerRef.current?.abort?.();
controllerRef.current = new AbortController();
@@ -157,7 +168,7 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
console.log('result:', res);
if (res?.status_code !== 200) {
if (res?.status_code && res?.status_code !== 200) {
setTokenResult({
error: true,
errorMessage:
@@ -212,7 +223,7 @@ const GroundLeft: React.FC<MessageProps> = forwardRef((props, ref) => {
const res = await queryModelVoices({
model: value
});
if (res?.status_code !== 200) {
if (res?.status_code && res?.status_code !== 200) {
setVoiceError({
error: true,
errorMessage: