-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python API implementation #2195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is a much needed PR to make TTS easier to use, thanks for doing that.
To add to the existing TODO:
Add support for voice conversion and voice cloning.
TTS/api.py
Outdated
from TTS.utils.manage import ModelManager | ||
|
||
|
||
class TTS(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know If calling it TTS is the best thing because it conflicts with the name of the package so it might prevent this kind of import: from TTS.api import TTS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get why you can't import like that.
I'm also open for suggestions 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you override TTS, might be annoying if you plan on importing other stuff from TTS. But yeah not super important.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you can go far by just import TTS
for any use-case
Again if you have a name suggestion shoot it.
self.load_model_by_name(model_name, gpu) | ||
|
||
@property | ||
def models(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know a good solution, but it would be nice to be able to have that list of model before instantiating that class with the model name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we could create a static method called list_tts_models and inside of it instance ModelManager and called the method list_models.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can keep the models in a python file instead of JSON and we can list it.
However can you give a code example for your intended use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just read the JSON
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already what tts.models
does. Are you suggesting something different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But it works only when the class is already initialized because it uses a model manager instance. But this could be avoided if models was a @staticmethod
instead.
Great PR :) |
* Draft implementation * Fix style * Add api tests * Fix lint * Update docs * Update tests * Set env * Fixup * Fixup * Fix lint * Revert
Early-stage Python API to load and run the released 🐸TTS models.
Feel free to comment...