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';
|
import { createVoice, deleteVoice, fetchVoices, previewVoice, updateVoice } from '../services/backendApi';
|
||||||
|
|
||||||
const SILICONFLOW_DEFAULT_MODEL = 'FunAudioLLM/CosyVoice2-0.5B';
|
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 buildSiliconflowVoiceKey = (rawId: string, model: string): string => {
|
||||||
const id = (rawId || '').trim();
|
const id = (rawId || '').trim();
|
||||||
@@ -408,15 +413,18 @@ const AddVoiceModal: React.FC<{
|
|||||||
<div className="grid grid-cols-2 gap-4">
|
<div className="grid grid-cols-2 gap-4">
|
||||||
<div className="space-y-1.5">
|
<div className="space-y-1.5">
|
||||||
<label className="text-[10px] font-black text-muted-foreground uppercase tracking-widest block">模型 (Model)</label>
|
<label className="text-[10px] font-black text-muted-foreground uppercase tracking-widest block">模型 (Model)</label>
|
||||||
<select
|
<Input
|
||||||
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"
|
className="h-9 bg-white/5 font-mono text-xs"
|
||||||
value={sfModel}
|
value={sfModel}
|
||||||
onChange={(e) => setSfModel(e.target.value)}
|
onChange={(e) => setSfModel(e.target.value)}
|
||||||
>
|
placeholder="例如: FunAudioLLM/CosyVoice2-0.5B"
|
||||||
<option value="FunAudioLLM/CosyVoice2-0.5B">FunAudioLLM/CosyVoice2-0.5B</option>
|
list="siliconflow-model-options"
|
||||||
<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>
|
<datalist id="siliconflow-model-options">
|
||||||
</select>
|
{SILICONFLOW_MODEL_SUGGESTIONS.map((m) => (
|
||||||
|
<option key={m} value={m} />
|
||||||
|
))}
|
||||||
|
</datalist>
|
||||||
</div>
|
</div>
|
||||||
<div className="space-y-1.5">
|
<div className="space-y-1.5">
|
||||||
<label className="text-[10px] font-black text-muted-foreground uppercase tracking-widest block">声音 ID (Voice)</label>
|
<label className="text-[10px] font-black text-muted-foreground uppercase tracking-widest block">声音 ID (Voice)</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user