from .speech_generator import SpeechGeneratorCTC, SpeechGeneratorCTCQwen, SpeechGeneratorCEQwen, SpeechGeneratorCosyVoice def build_speech_generator(config): generator_type = getattr(config, 'speech_generator_type', 'ctc') if generator_type == 'ctc': return SpeechGeneratorCTC(config) elif generator_type == 'ctc_qwen': return SpeechGeneratorCTCQwen(config) elif generator_type == 'ce_qwen': return SpeechGeneratorCEQwen(config) elif generator_type == 'cosy_qwen': return SpeechGeneratorCosyVoice(config) raise ValueError(f'Unknown generator type: {generator_type}')