Merge pull request #449 from guoyangzhen/fix/optional-tts-dependency
fix: make kokoro TTS optional to resolve num2words Python 3.12+ incompatibility
This commit is contained in:
+3
-1
@@ -1,4 +1,3 @@
|
|||||||
kokoro==0.9.4
|
|
||||||
certifi==2025.4.26
|
certifi==2025.4.26
|
||||||
fastapi>=0.115.12
|
fastapi>=0.115.12
|
||||||
flask>=3.1.0
|
flask>=3.1.0
|
||||||
@@ -46,3 +45,6 @@ openai
|
|||||||
sniffio
|
sniffio
|
||||||
ordered_set
|
ordered_set
|
||||||
pypinyin
|
pypinyin
|
||||||
|
|
||||||
|
# Optional: TTS support (requires Python <3.12)
|
||||||
|
# pip install kokoro==0.9.4 soundfile ipython
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ try:
|
|||||||
from IPython.display import display, Audio
|
from IPython.display import display, Audio
|
||||||
import soundfile as sf
|
import soundfile as sf
|
||||||
except ImportError:
|
except ImportError:
|
||||||
print("Speech synthesis disabled. Please install the kokoro package.")
|
print("Speech synthesis disabled. To enable TTS, install: pip install kokoro==0.9.4 soundfile ipython")
|
||||||
|
print("Note: kokoro requires Python <3.12 due to num2words dependency.")
|
||||||
IMPORT_FOUND = False
|
IMPORT_FOUND = False
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user