Spaces:
Running
Running
zhzluke96 commited on
Commit ·
43c9aae
1
Parent(s): 563fae6
update
Browse files13 unmodified lines1415161718192021222324252611 unmodified lines383940414243446 unmodified lines5152535455565713 unmodified lines# huggingface Error:# RuntimeError: CUDA must not be initialized in the main process on Spaces with Stateless GPU environment.# You can look at this Stacktrace to find out which part of your code triggered a CUDA initload_event = threading.Event()def load_chat_tts_in_thread():global chat_ttsif chat_tts:load_event.set()returnlogger.info("Loading ChatTTS models")11 unmodified lines)devices.torch_gc()load_event.set()logger.info("ChatTTS models loaded")6 unmodified linesdef load_chat_tts():if chat_tts is None:initialize_chat_tts().join()load_event.wait()if chat_tts is None:raise Exception("Failed to load ChatTTS models")return chat_tts13 unmodified lines141516171819202122232411 unmodified lines3637383940416 unmodified lines48495051525313 unmodified lines# huggingface Error:# RuntimeError: CUDA must not be initialized in the main process on Spaces with Stateless GPU environment.# You can look at this Stacktrace to find out which part of your code triggered a CUDA initdef load_chat_tts_in_thread():global chat_ttsif chat_tts:returnlogger.info("Loading ChatTTS models")11 unmodified lines)devices.torch_gc()logger.info("ChatTTS models loaded")6 unmodified linesdef load_chat_tts():if chat_tts is None:initialize_chat_tts().join()if chat_tts is None:raise Exception("Failed to load ChatTTS models")return chat_tts
modules/models.py-4