TTS model from select to input
This commit is contained in:
@@ -5,6 +5,11 @@ import { Voice } from '../types';
|
||||
import { createVoice, deleteVoice, fetchVoices, previewVoice, updateVoice } from '../services/backendApi';
|
||||
|
||||
const SILICONFLOW_DEFAULT_MODEL = 'FunAudioLLM/CosyVoice2-0.5B';
|
||||
const SILICONFLOW_MODEL_SUGGESTIONS = [
|
||||
'FunAudioLLM/CosyVoice2-0.5B',
|
||||
'fishaudio/fish-speech-1.5',
|
||||
'fishaudio/fish-speech-1.4',
|
||||
];
|
||||
|
||||
const buildSiliconflowVoiceKey = (rawId: string, model: string): string => {
|
||||
const id = (rawId || '').trim();
|
||||
@@ -408,15 +413,18 @@ const AddVoiceModal: React.FC<{
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-[10px] font-black text-muted-foreground uppercase tracking-widest block">模型 (Model)</label>
|
||||
<select
|
||||
className="flex h-9 w-full rounded-md border-0 bg-white/5 px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary/50 text-foreground [&>option]:bg-card"
|
||||
<Input
|
||||
className="h-9 bg-white/5 font-mono text-xs"
|
||||
value={sfModel}
|
||||
onChange={(e) => setSfModel(e.target.value)}
|
||||
>
|
||||
<option value="FunAudioLLM/CosyVoice2-0.5B">FunAudioLLM/CosyVoice2-0.5B</option>
|
||||
<option value="fishaudio/fish-speech-1.5">fishaudio/fish-speech-1.5</option>
|
||||
<option value="fishaudio/fish-speech-1.4">fishaudio/fish-speech-1.4</option>
|
||||
</select>
|
||||
placeholder="例如: FunAudioLLM/CosyVoice2-0.5B"
|
||||
list="siliconflow-model-options"
|
||||
/>
|
||||
<datalist id="siliconflow-model-options">
|
||||
{SILICONFLOW_MODEL_SUGGESTIONS.map((m) => (
|
||||
<option key={m} value={m} />
|
||||
))}
|
||||
</datalist>
|
||||
</div>
|
||||
<div className="space-y-1.5">
|
||||
<label className="text-[10px] font-black text-muted-foreground uppercase tracking-widest block">声音 ID (Voice)</label>
|
||||
|
||||
Reference in New Issue
Block a user