rentruewang / koila

Prevent PyTorch's `CUDA error: out of memory` in just 1 line of code.
https://koila.rentruewang.com
MIT License
1.82k stars 63 forks source link

i have no idea how to use Koila in my code #30

Closed saleham5 closed 1 year ago

saleham5 commented 1 year ago

Hey, I use Coqui-ai TTS through a simple Python code.

from TTS.api import TTS

tts = TTS(model_name="MODEL NAME",
          progress_bar=True,
          gpu=True)

tts.tts_to_file(text="TEXT", file_path='Audio.wav')

but I always get CUDA out of memory. and I'm not really sure how to use Koila with my code or Coqui-ai tts in general. any help?

rentruewang commented 1 year ago

Hi, thanks for taking time to ask this!

Koila is used for when you are directly interacting with PyTorch tensors, since TTS is a higher abstraction above, unfortunately, it's impossible to use Koila here.

If I may make a suggestion, although I don't personally use TTS library, it seems like you are doing only inference here. Inference is pretty cheap so doing it on CPU wouldn't be a problem (you basically only needs GPU when training). Hope that helps!

saleham5 commented 1 year ago

Thank you so much for the fast reply. And I didn't know that, I might actually go full CPU and see what will happen. Thank you again you are an amazing Dev

rentruewang commented 1 year ago

You're welcome :)