KoljaB / RealtimeTTS

Converts text to speech in realtime
1.39k stars 119 forks source link

Add manual device choice #90

Closed vancoder1 closed 3 weeks ago

vancoder1 commented 3 weeks ago

This pull request introduces the ability to manually select a torch device using the device parameter in CoquiEngine's constructor. Specifically, changes on lines 467-472 ensure that the device choice is correctly handled, with automatic fallback if no device is provided or if the provided device is invalid.

To maintain code cleanliness and conciseness, the use_mps class variable has been removed. However, it's important to note that this change may potentially impact existing user code that relies on the use_mps variable.

Additionally, I've locally tested this code to ensure its functionality.

I'm open to any discussions regarding these changes.

KoljaB commented 3 weeks ago

Looks good, thanks a lot. Will update the Readme soon.