Skip to content

Commit

Permalink
修复:声音克隆异常问题
Browse files Browse the repository at this point in the history
  • Loading branch information
modstart committed Nov 20, 2024
1 parent 1de5dfe commit 07e52de
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 15 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v0.0.5

- 修复:声音克隆异常问题

## v0.0.4

- 优化:图表文件静态化
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aigcpanel",
"version": "0.0.4",
"version": "0.0.5-beta",
"main": "dist-electron/main/index.js",
"description": "一站式AI数字人系统",
"author": "ModStartLib",
Expand Down
17 changes: 14 additions & 3 deletions src/components/Server/ServerSelector.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<script setup lang="ts">
import {useServerStore} from "../../store/modules/server";
import {EnumServerStatus} from "../../types/Server";
import {onMounted, ref, watch} from "vue";
import {computed, onMounted, ref, watch} from "vue";
const serverStore = useServerStore()
Expand All @@ -11,6 +11,14 @@ const props = defineProps<{
}>()
const valueStatus = ref(EnumServerStatus.STOPPED)
const recordsFilter = computed(() => {
const records = serverStore.records.filter(s => s.functions.includes(props.functionName))
if (records.length === 0) {
valueStatus.value = EnumServerStatus.STOPPED
}
return records
})
onMounted(() => {
watch(() => select.value.modelValue, async (value) => {
const server = await serverStore.getByKey(value)
Expand All @@ -27,7 +35,7 @@ onMounted(() => {

<template>
<a-select ref="select" :placeholder="$t('选择模型')" size="small">
<a-option v-for="server in serverStore.records.filter(s => s.functions.includes(props.functionName))"
<a-option v-for="server in recordsFilter"
:key="server.key"
:value="server.key">
<div class="text-sm flex items-center py-2 flex-nowrap truncate no-wrap">
Expand All @@ -45,9 +53,12 @@ onMounted(() => {
<div v-if="valueStatus===EnumServerStatus.RUNNING"
class="w-2 h-2 bg-green-700 rounded-full mr-1 flex-shrink-0"></div>
<div v-else class="w-2 h-2 bg-red-700 rounded-full mr-1 flex-shrink-0"></div>
<div>
<div v-if="recordsFilter.length>0">
{{ data?.label }}
</div>
<div v-else>
{{ $t('没有可用模型') }}
</div>
</div>
</template>
</a-select>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Sound/SoundCloneCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ watch(() => formData.value.serverKey, async (value) => {
Dialog.tipError(mapError(res.msg))
return
}
formDataParam.value = res.data.functions.soundClone.param || []
formDataParam.value = res.data.functions.soundClone?.param || []
}
})
const doSubmit = async () => {
formData.value.param = paramForm.value.getValue()
formData.value.param = paramForm.value?.getValue() || {}
if (!formData.value.serverKey) {
Dialog.tipError(t('请选择模型'))
return
Expand Down
4 changes: 2 additions & 2 deletions src/components/Sound/SoundTtsCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ watch(() => formData.value.serverKey, async (value) => {
Dialog.tipError(mapError(res.msg))
return
}
formDataParam.value = res.data.functions.soundTts.param || []
formDataParam.value = res.data.functions.soundTts?.param || []
}
})
const doSubmit = async () => {
formData.value.param = paramForm.value.getValue()
formData.value.param = paramForm.value?.getValue() || {}
if (!formData.value.serverKey) {
Dialog.tipError(t('请选择模型'))
return
Expand Down
4 changes: 2 additions & 2 deletions src/components/Video/VideoGenCreate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ watch(() => formData.value.serverKey, async (value) => {
Dialog.tipError(mapError(res.msg))
return
}
formDataParam.value = res.data.functions.videoGen.param || []
formDataParam.value = res.data.functions.videoGen?.param || []
}
})
Expand All @@ -70,7 +70,7 @@ onMounted(async () => {
})
const doSubmit = async () => {
formData.value.param = paramForm.value?.getValue() as any
formData.value.param = paramForm.value?.getValue() || {}
if (!formData.value.serverKey) {
Dialog.tipError(t('请选择模型'))
return
Expand Down
5 changes: 3 additions & 2 deletions src/lang/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
"2615bdd6": "Where to find model files?",
"26276a3a": "Stop Service",
"263ee622": "About",
"26aa0dba": "已经是最新版本",
"26aa0dba": "Current version is up to date",
"26ba5101": "Extracting %s",
"26d1d59f": "Select model service directory",
"26e92d2b": "Show Main Interface",
Expand Down Expand Up @@ -137,6 +137,7 @@
"303ab60e": "Local Model",
"31450307": "Check for Updates",
"319103b8": "Model Info",
"31ff78eb": "No available models",
"32226b29": "Deleting",
"32a57afe": "Ask Every Time",
"3345e9a5": "Add Role",
Expand Down Expand Up @@ -206,4 +207,4 @@
"79ccebce": "Add video template",
"7bf1ff1a": "Select video file",
"7fca1c6b": "Import a model zip file on this page"
}
}
1 change: 1 addition & 0 deletions src/lang/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
"正在解压文件": "4b9efbfc",
"正常": "000d5f35",
"每次询问": "32a57afe",
"没有可用模型": "31ff78eb",
"添加": "000da405",
"添加模型服务": "5dc07189",
"添加线上模型": "73b1d37a",
Expand Down
1 change: 1 addition & 0 deletions src/lang/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@
"303ab60e": "本地模型",
"31450307": "检测更新",
"319103b8": "模型信息",
"31ff78eb": "没有可用模型",
"32226b29": "正在删除",
"32a57afe": "每次询问",
"3345e9a5": "添加角色",
Expand Down
4 changes: 1 addition & 3 deletions src/service/SoundCloneService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ export type SoundCloneRecord = {
promptWav: string;
promptText: string;
text: string;
speed: number;
seed: number;
param?: any;

status?: 'queue' | 'running' | 'success' | 'fail';
Expand Down Expand Up @@ -89,7 +87,7 @@ export const SoundCloneService = {
const fields = [
'serverName', 'serverTitle', 'serverVersion',
'promptName', 'promptWav', 'promptText',
'text', 'speed', 'seed', 'param',
'text', 'param',
'status', 'statusMsg', 'startTime', 'endTime',
]
record = this.encodeRecord(record)
Expand Down

0 comments on commit 07e52de

Please sign in to comment.