File size: 1,236 Bytes
24437ee |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
"""
Genie TTS Hugging Face Spaces Deployment Package
模块化的Genie TTS部署包,将原本过于内聚的app.py拆分为多个模块:
- installer.py: 依赖安装和管理
- config.py: 配置和常量管理
- tts_engine.py: TTS核心功能
- ui_utils.py: UI辅助函数
- app.py: 主应用和Gradio界面
这种架构提高了代码的可维护性、可测试性和可扩展性。
"""
from .installer import setup_genie_import
from .config import (
AVAILABLE_CHARACTERS, DEFAULT_CHARACTER, DEFAULT_TEXT,
EXAMPLE_TEXTS, UI_CONFIG, UI_TEXT, APP_TITLE, APP_DESCRIPTION
)
from .tts_engine import GenieTTSInterface, tts_interface
from .ui_utils import clear_all, load_example, get_audio_duration, create_tts_wrapper, create_system_status_display
__version__ = "1.0.0"
__author__ = "Genie TTS Team"
__all__ = [
# 安装相关
'setup_genie_import',
# 配置相关
'AVAILABLE_CHARACTERS', 'DEFAULT_CHARACTER', 'DEFAULT_TEXT',
'EXAMPLE_TEXTS', 'UI_CONFIG', 'UI_TEXT', 'APP_TITLE', 'APP_DESCRIPTION',
# TTS引擎
'GenieTTSInterface', 'tts_interface',
# UI工具
'clear_all', 'load_example', 'get_audio_duration',
'create_tts_wrapper', 'create_system_status_display'
] |