-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2060 from elebumm/develop
Update 3.3.0
- Loading branch information
Showing
29 changed files
with
214 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,38 @@ | ||
import random | ||
|
||
from elevenlabs import generate, save | ||
from elevenlabs import save | ||
from elevenlabs.client import ElevenLabs | ||
|
||
from utils import settings | ||
|
||
voices = [ | ||
"Adam", | ||
"Antoni", | ||
"Arnold", | ||
"Bella", | ||
"Domi", | ||
"Elli", | ||
"Josh", | ||
"Rachel", | ||
"Sam", | ||
] | ||
|
||
|
||
class elevenlabs: | ||
def __init__(self): | ||
self.max_chars = 2500 | ||
self.voices = voices | ||
self.client: ElevenLabs = None | ||
|
||
def run(self, text, filepath, random_voice: bool = False): | ||
if self.client is None: | ||
self.initialize() | ||
if random_voice: | ||
voice = self.randomvoice() | ||
else: | ||
voice = str(settings.config["settings"]["tts"]["elevenlabs_voice_name"]).capitalize() | ||
|
||
audio = self.client.generate(text=text, voice=voice, model="eleven_multilingual_v1") | ||
save(audio=audio, filename=filepath) | ||
|
||
def initialize(self): | ||
if settings.config["settings"]["tts"]["elevenlabs_api_key"]: | ||
api_key = settings.config["settings"]["tts"]["elevenlabs_api_key"] | ||
else: | ||
raise ValueError( | ||
"You didn't set an Elevenlabs API key! Please set the config variable ELEVENLABS_API_KEY to a valid API key." | ||
) | ||
|
||
audio = generate(api_key=api_key, text=text, voice=voice, model="eleven_multilingual_v1") | ||
save(audio=audio, filename=filepath) | ||
self.client = ElevenLabs(api_key=api_key) | ||
|
||
def randomvoice(self): | ||
return random.choice(self.voices) | ||
if self.client is None: | ||
self.initialize() | ||
return random.choice(self.client.voices.get_all().voices).voice_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,24 @@ | ||
boto3==1.26.142 | ||
botocore==1.29.142 | ||
gTTS==2.3.2 | ||
boto3==1.34.127 | ||
botocore==1.34.127 | ||
gTTS==2.5.1 | ||
moviepy==1.0.3 | ||
playwright==1.34.0 | ||
praw==7.7.0 | ||
playwright==1.44.0 | ||
praw==7.7.1 | ||
prawcore~=2.3.0 | ||
requests==2.31.0 | ||
rich==13.4.1 | ||
requests==2.32.3 | ||
rich==13.7.1 | ||
toml==0.10.2 | ||
translators==5.7.6 | ||
translators==5.9.2 | ||
pyttsx3==2.90 | ||
Pillow==9.5.0 | ||
tomlkit==0.11.8 | ||
Flask==2.3.3 | ||
Pillow==10.3.0 | ||
tomlkit==0.12.5 | ||
Flask==3.0.3 | ||
clean-text==0.6.0 | ||
unidecode==1.3.6 | ||
spacy==3.5.3 | ||
torch==2.0.1 | ||
transformers==4.29.2 | ||
unidecode==1.3.8 | ||
spacy==3.7.5 | ||
torch==2.3.1 | ||
transformers==4.41.2 | ||
ffmpeg-python==0.2.0 | ||
elevenlabs==0.2.17 | ||
yt-dlp==2023.7.6 | ||
elevenlabs==1.3.0 | ||
yt-dlp==2024.5.27 | ||
numpy==1.26.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.