diff --git a/manim_voiceover/services/azure.py b/manim_voiceover/services/azure.py index aa61bf8..202b897 100644 --- a/manim_voiceover/services/azure.py +++ b/manim_voiceover/services/azure.py @@ -1,13 +1,16 @@ import os -from pathlib import Path import sys -from dotenv import load_dotenv, find_dotenv +from pathlib import Path + +from dotenv import find_dotenv, load_dotenv +from manim import logger + from manim_voiceover.helper import ( create_dotenv_file, prompt_ask_missing_extras, remove_bookmarks, ) -from manim import logger +from manim_voiceover.services.base import SpeechService try: import azure.cognitiveservices.speech as speechsdk @@ -16,7 +19,6 @@ 'Missing packages. Run `pip install "manim-voiceover[azure]"` to use AzureService.' ) -from manim_voiceover.services.base import SpeechService load_dotenv(find_dotenv(usecwd=True)) diff --git a/manim_voiceover/services/elevenlabs.py b/manim_voiceover/services/elevenlabs.py index 0f94c9a..eb19d38 100644 --- a/manim_voiceover/services/elevenlabs.py +++ b/manim_voiceover/services/elevenlabs.py @@ -6,7 +6,8 @@ from dotenv import find_dotenv, load_dotenv from manim import logger -from manim_voiceover.helper import create_dotenv_file +from manim_voiceover.helper import create_dotenv_file, remove_bookmarks +from manim_voiceover.services.base import SpeechService try: from elevenlabs import Voice, VoiceSettings, generate, save, voices @@ -17,9 +18,6 @@ ) -from manim_voiceover.helper import create_dotenv_file, remove_bookmarks -from manim_voiceover.services.base import SpeechService - load_dotenv(find_dotenv(usecwd=True)) @@ -51,7 +49,7 @@ def __init__( voice_name: Optional[str] = None, voice_id: Optional[str] = None, model: str = "eleven_monolingual_v1", - voice_settings: Optional[Union[VoiceSettings, dict]] = None, + voice_settings: Optional[Union["VoiceSettings", dict]] = None, transcription_model: str = "base", **kwargs, ): diff --git a/manim_voiceover/services/openai.py b/manim_voiceover/services/openai.py index 263edac..025fc40 100644 --- a/manim_voiceover/services/openai.py +++ b/manim_voiceover/services/openai.py @@ -1,14 +1,16 @@ import os import sys from pathlib import Path + +from dotenv import find_dotenv, load_dotenv from manim import logger -from dotenv import load_dotenv, find_dotenv from manim_voiceover.helper import ( create_dotenv_file, prompt_ask_missing_extras, remove_bookmarks, ) +from manim_voiceover.services.base import SpeechService try: import openai @@ -18,7 +20,6 @@ 'Run `pip install "manim-voiceover[openai]"` to use OpenAIService.' ) -from manim_voiceover.services.base import SpeechService load_dotenv(find_dotenv(usecwd=True))