Skip to content

Commit

Permalink
Improve imports
Browse files Browse the repository at this point in the history
  • Loading branch information
osolmaz committed Feb 25, 2024
1 parent f082e05 commit 2ad5f97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
10 changes: 6 additions & 4 deletions manim_voiceover/services/azure.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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))

Expand Down
8 changes: 3 additions & 5 deletions manim_voiceover/services/elevenlabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))


Expand Down Expand Up @@ -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,
):
Expand Down
5 changes: 3 additions & 2 deletions manim_voiceover/services/openai.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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))

Expand Down

0 comments on commit 2ad5f97

Please sign in to comment.