feat: Implement Aliyun TTS backend integration and API key management
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
||||
<link rel="icon" type="image/svg+xml" href="/qwen.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<link rel="preload" href="/fonts/noto-serif-regular.woff2" as="font" type="font/woff2" crossorigin>
|
||||
<title>Qwen3-TTS-WebUI</title>
|
||||
|
||||
1
qwen3-tts-frontend/public/qwen.svg
Normal file
1
qwen3-tts-frontend/public/qwen.svg
Normal file
@@ -0,0 +1 @@
|
||||
Redirecting to /@lobehub/icons-static-svg@1.78.0/icons/qwen.svg
|
||||
@@ -32,6 +32,7 @@ const formSchema = z.object({
|
||||
top_k: z.number().min(1).max(100).optional(),
|
||||
top_p: z.number().min(0).max(1).optional(),
|
||||
repetition_penalty: z.number().min(0).max(2).optional(),
|
||||
backend: z.string().optional(),
|
||||
})
|
||||
|
||||
type FormData = z.infer<typeof formSchema>
|
||||
@@ -74,6 +75,7 @@ const CustomVoiceForm = forwardRef<CustomVoiceFormHandle>((_props, ref) => {
|
||||
top_k: 20,
|
||||
top_p: 0.7,
|
||||
repetition_penalty: 1.05,
|
||||
backend: 'local',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -88,6 +90,7 @@ const CustomVoiceForm = forwardRef<CustomVoiceFormHandle>((_props, ref) => {
|
||||
setValue('top_k', params.top_k || 20)
|
||||
setValue('top_p', params.top_p || 0.7)
|
||||
setValue('repetition_penalty', params.repetition_penalty || 1.05)
|
||||
setValue('backend', params.backend || 'local')
|
||||
}
|
||||
}))
|
||||
|
||||
@@ -131,6 +134,22 @@ const CustomVoiceForm = forwardRef<CustomVoiceFormHandle>((_props, ref) => {
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-2">
|
||||
<div className="space-y-0.5">
|
||||
<Label>后端选择</Label>
|
||||
<Select
|
||||
value={watch('backend')}
|
||||
onValueChange={(value: string) => setValue('backend', value)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="local">本地模型</SelectItem>
|
||||
<SelectItem value="aliyun">阿里云 API</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="space-y-0.5">
|
||||
<IconLabel icon={Globe2} tooltip="语言" required />
|
||||
<Select
|
||||
|
||||
@@ -37,6 +37,7 @@ const formSchema = z.object({
|
||||
top_k: z.number().min(1).max(100).optional(),
|
||||
top_p: z.number().min(0).max(1).optional(),
|
||||
repetition_penalty: z.number().min(0).max(2).optional(),
|
||||
backend: z.string().optional(),
|
||||
})
|
||||
|
||||
type FormData = z.infer<typeof formSchema>
|
||||
@@ -75,6 +76,7 @@ function VoiceCloneForm() {
|
||||
top_k: 20,
|
||||
top_p: 0.7,
|
||||
repetition_penalty: 1.05,
|
||||
backend: 'local',
|
||||
} as Partial<FormData>,
|
||||
})
|
||||
|
||||
@@ -233,6 +235,22 @@ function VoiceCloneForm() {
|
||||
|
||||
<div className={step === 2 ? 'block space-y-4' : 'hidden'}>
|
||||
{/* Step 2: Synthesis Options */}
|
||||
<div className="space-y-0.5">
|
||||
<Label>后端选择</Label>
|
||||
<Select
|
||||
value={watch('backend')}
|
||||
onValueChange={(value: string) => setValue('backend', value)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="local">本地模型</SelectItem>
|
||||
<SelectItem value="aliyun">阿里云 API</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="space-y-0.5">
|
||||
<IconLabel icon={Globe2} tooltip="语言(可选)" />
|
||||
<Select
|
||||
|
||||
@@ -31,6 +31,7 @@ const formSchema = z.object({
|
||||
top_k: z.number().min(1).max(100).optional(),
|
||||
top_p: z.number().min(0).max(1).optional(),
|
||||
repetition_penalty: z.number().min(0).max(2).optional(),
|
||||
backend: z.string().optional(),
|
||||
})
|
||||
|
||||
type FormData = z.infer<typeof formSchema>
|
||||
@@ -71,6 +72,7 @@ const VoiceDesignForm = forwardRef<VoiceDesignFormHandle>((_props, ref) => {
|
||||
top_k: 20,
|
||||
top_p: 0.7,
|
||||
repetition_penalty: 1.05,
|
||||
backend: 'local',
|
||||
},
|
||||
})
|
||||
|
||||
@@ -84,6 +86,7 @@ const VoiceDesignForm = forwardRef<VoiceDesignFormHandle>((_props, ref) => {
|
||||
setValue('top_k', params.top_k || 20)
|
||||
setValue('top_p', params.top_p || 0.7)
|
||||
setValue('repetition_penalty', params.repetition_penalty || 1.05)
|
||||
setValue('backend', params.backend || 'local')
|
||||
}
|
||||
}))
|
||||
|
||||
@@ -122,6 +125,22 @@ const VoiceDesignForm = forwardRef<VoiceDesignFormHandle>((_props, ref) => {
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit(onSubmit)} className="space-y-2">
|
||||
<div className="space-y-0.5">
|
||||
<Label>后端选择</Label>
|
||||
<Select
|
||||
value={watch('backend')}
|
||||
onValueChange={(value: string) => setValue('backend', value)}
|
||||
>
|
||||
<SelectTrigger>
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value="local">本地模型</SelectItem>
|
||||
<SelectItem value="aliyun">阿里云 API</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</div>
|
||||
|
||||
<div className="space-y-0.5">
|
||||
<IconLabel icon={Globe2} tooltip="语言" required />
|
||||
<Select
|
||||
|
||||
@@ -247,6 +247,9 @@ export const ttsApi = {
|
||||
if (data.repetition_penalty !== undefined) {
|
||||
formData.append('repetition_penalty', String(data.repetition_penalty))
|
||||
}
|
||||
if (data.backend) {
|
||||
formData.append('backend', data.backend)
|
||||
}
|
||||
|
||||
const response = await apiClient.post<JobCreateResponse>(
|
||||
API_ENDPOINTS.TTS.VOICE_CLONE,
|
||||
|
||||
@@ -18,6 +18,7 @@ export interface CustomVoiceForm {
|
||||
top_k?: number
|
||||
top_p?: number
|
||||
repetition_penalty?: number
|
||||
backend?: string
|
||||
}
|
||||
|
||||
export interface VoiceDesignForm {
|
||||
@@ -29,6 +30,7 @@ export interface VoiceDesignForm {
|
||||
top_k?: number
|
||||
top_p?: number
|
||||
repetition_penalty?: number
|
||||
backend?: string
|
||||
}
|
||||
|
||||
export interface VoiceCloneForm {
|
||||
@@ -43,4 +45,5 @@ export interface VoiceCloneForm {
|
||||
top_k?: number
|
||||
top_p?: number
|
||||
repetition_penalty?: number
|
||||
backend?: string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user