Create __init__.py
Browse files- engines/__init__.py +137 -0
engines/__init__.py
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from .base_engine import BaseEngine, TimingInfo
|
| 2 |
+
|
| 3 |
+
__all__ = [
|
| 4 |
+
"BaseEngine", "TimingInfo",
|
| 5 |
+
"AzureEngine", "AzureVoice",
|
| 6 |
+
"SystemEngine", "SystemVoice",
|
| 7 |
+
"ElevenlabsEngine", "ElevenlabsVoice",
|
| 8 |
+
"CoquiEngine", "CoquiVoice",
|
| 9 |
+
"OpenAIEngine", "OpenAIVoice",
|
| 10 |
+
"GTTSEngine", "GTTSVoice",
|
| 11 |
+
"ParlerEngine", "ParlerVoice",
|
| 12 |
+
"EdgeEngine", "EdgeVoice",
|
| 13 |
+
"StyleTTSEngine", "StyleTTSVoice",
|
| 14 |
+
"PiperEngine", "PiperVoice",
|
| 15 |
+
"KokoroEngine", "KokoroVoice",
|
| 16 |
+
"OrpheusEngine", "OrpheusVoice",
|
| 17 |
+
]
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
# Lazy loader functions for the engines in this subpackage.
|
| 21 |
+
def _load_azure_engine():
|
| 22 |
+
from .azure_engine import AzureEngine, AzureVoice
|
| 23 |
+
globals()["AzureEngine"] = AzureEngine
|
| 24 |
+
globals()["AzureVoice"] = AzureVoice
|
| 25 |
+
return AzureEngine
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def _load_system_engine():
|
| 29 |
+
from .system_engine import SystemEngine, SystemVoice
|
| 30 |
+
globals()["SystemEngine"] = SystemEngine
|
| 31 |
+
globals()["SystemVoice"] = SystemVoice
|
| 32 |
+
return SystemEngine
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def _load_elevenlabs_engine():
|
| 36 |
+
from .elevenlabs_engine import ElevenlabsEngine, ElevenlabsVoice
|
| 37 |
+
globals()["ElevenlabsEngine"] = ElevenlabsEngine
|
| 38 |
+
globals()["ElevenlabsVoice"] = ElevenlabsVoice
|
| 39 |
+
return ElevenlabsEngine
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
def _load_coqui_engine():
|
| 43 |
+
from .coqui_engine import CoquiEngine, CoquiVoice
|
| 44 |
+
globals()["CoquiEngine"] = CoquiEngine
|
| 45 |
+
globals()["CoquiVoice"] = CoquiVoice
|
| 46 |
+
return CoquiEngine
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
def _load_openai_engine():
|
| 50 |
+
from .openai_engine import OpenAIEngine, OpenAIVoice
|
| 51 |
+
globals()["OpenAIEngine"] = OpenAIEngine
|
| 52 |
+
globals()["OpenAIVoice"] = OpenAIVoice
|
| 53 |
+
return OpenAIEngine
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _load_gtts_engine():
|
| 57 |
+
from .gtts_engine import GTTSEngine, GTTSVoice
|
| 58 |
+
globals()["GTTSEngine"] = GTTSEngine
|
| 59 |
+
globals()["GTTSVoice"] = GTTSVoice
|
| 60 |
+
return GTTSEngine
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def _load_parler_engine():
|
| 64 |
+
from .parler_engine import ParlerEngine, ParlerVoice
|
| 65 |
+
globals()["ParlerEngine"] = ParlerEngine
|
| 66 |
+
globals()["ParlerVoice"] = ParlerVoice
|
| 67 |
+
return ParlerEngine
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def _load_edge_engine():
|
| 71 |
+
from .edge_engine import EdgeEngine, EdgeVoice
|
| 72 |
+
globals()["EdgeEngine"] = EdgeEngine
|
| 73 |
+
globals()["EdgeVoice"] = EdgeVoice
|
| 74 |
+
return EdgeEngine
|
| 75 |
+
|
| 76 |
+
|
| 77 |
+
def _load_style_engine():
|
| 78 |
+
from .style_engine import StyleTTSEngine, StyleTTSVoice
|
| 79 |
+
globals()["StyleTTSEngine"] = StyleTTSEngine
|
| 80 |
+
globals()["StyleTTSVoice"] = StyleTTSVoice
|
| 81 |
+
return StyleTTSEngine
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def _load_piper_engine():
|
| 85 |
+
from .piper_engine import PiperEngine, PiperVoice
|
| 86 |
+
globals()["PiperEngine"] = PiperEngine
|
| 87 |
+
globals()["PiperVoice"] = PiperVoice
|
| 88 |
+
return PiperEngine
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def _load_kokoro_engine():
|
| 92 |
+
from .kokoro_engine import KokoroEngine, KokoroVoice
|
| 93 |
+
globals()["KokoroEngine"] = KokoroEngine
|
| 94 |
+
globals()["KokoroVoice"] = KokoroVoice
|
| 95 |
+
return KokoroEngine
|
| 96 |
+
|
| 97 |
+
|
| 98 |
+
def _load_orpheus_engine():
|
| 99 |
+
from .orpheus_engine import OrpheusEngine, OrpheusVoice
|
| 100 |
+
globals()["OrpheusEngine"] = OrpheusEngine
|
| 101 |
+
globals()["OrpheusVoice"] = OrpheusVoice
|
| 102 |
+
return OrpheusEngine
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
# Map attribute names to lazy loader functions.
|
| 106 |
+
_lazy_imports = {
|
| 107 |
+
"AzureEngine": _load_azure_engine,
|
| 108 |
+
"AzureVoice": _load_azure_engine,
|
| 109 |
+
"SystemEngine": _load_system_engine,
|
| 110 |
+
"SystemVoice": _load_system_engine,
|
| 111 |
+
"ElevenlabsEngine": _load_elevenlabs_engine,
|
| 112 |
+
"ElevenlabsVoice": _load_elevenlabs_engine,
|
| 113 |
+
"CoquiEngine": _load_coqui_engine,
|
| 114 |
+
"CoquiVoice": _load_coqui_engine,
|
| 115 |
+
"OpenAIEngine": _load_openai_engine,
|
| 116 |
+
"OpenAIVoice": _load_openai_engine,
|
| 117 |
+
"GTTSEngine": _load_gtts_engine,
|
| 118 |
+
"GTTSVoice": _load_gtts_engine,
|
| 119 |
+
"ParlerEngine": _load_parler_engine,
|
| 120 |
+
"ParlerVoice": _load_parler_engine,
|
| 121 |
+
"EdgeEngine": _load_edge_engine,
|
| 122 |
+
"EdgeVoice": _load_edge_engine,
|
| 123 |
+
"StyleTTSEngine": _load_style_engine,
|
| 124 |
+
"StyleTTSVoice": _load_style_engine,
|
| 125 |
+
"PiperEngine": _load_piper_engine,
|
| 126 |
+
"PiperVoice": _load_piper_engine,
|
| 127 |
+
"KokoroEngine": _load_kokoro_engine,
|
| 128 |
+
"KokoroVoice": _load_kokoro_engine,
|
| 129 |
+
"OrpheusEngine": _load_orpheus_engine,
|
| 130 |
+
"OrpheusVoice": _load_orpheus_engine,
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
def __getattr__(name):
|
| 135 |
+
if name in _lazy_imports:
|
| 136 |
+
return _lazy_imports[name]()
|
| 137 |
+
raise AttributeError(f"module {__name__} has no attribute {name}")
|