feat: update user preferences and system settings management
This commit is contained in:
@@ -38,7 +38,6 @@ 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>
|
||||
@@ -78,16 +77,9 @@ function VoiceCloneForm() {
|
||||
top_k: 20,
|
||||
top_p: 0.7,
|
||||
repetition_penalty: 1.05,
|
||||
backend: preferences?.default_backend || 'local',
|
||||
} as Partial<FormData>,
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (preferences?.default_backend) {
|
||||
setValue('backend', preferences.default_backend)
|
||||
}
|
||||
}, [preferences?.default_backend, setValue])
|
||||
|
||||
useEffect(() => {
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
@@ -243,22 +235,6 @@ 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
|
||||
|
||||
Reference in New Issue
Block a user