metavoice-src icon indicating copy to clipboard operation
metavoice-src copied to clipboard

windows support / Temp wav file error

Open aroslanov opened this issue 1 year ago • 8 comments

When I run sample.py locally on Windows 11, the code crashes on line 84 of enhancer.py.

Exception has occurred: LibsndfileError
Error opening 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpms4y14wd.wav': System error.
  File "D:\metavoice-src\fam\llm\enhancers.py", line 84, in __call__
    save_audio(output_file, enhanced, self.df_state.sr())
  File "D:\metavoice-src\fam\llm\sample.py", line 506, in _sample_utterance_batch
    enhancer(str(wav_file) + ".wav", enhanced_tmp.name)
  File "D:\metavoice-src\fam\llm\sample.py", line 544, in sample_utterance
    return _sample_utterance_batch(
  File "D:\metavoice-src\fam\llm\sample.py", line 695, in <module>
    sample_utterance(
soundfile.LibsndfileError: Error opening 'C:\\Users\\user\\AppData\\Local\\Temp\\tmpms4y14wd.wav': System error.

After adding a few breakpoints, I discovered that a zero-length WAV file appears at the temporary path before the crash. However, it gets deleted at the moment of the crash. On the other hand, the WAV file in the samples directory is being created successfully. Could it be an issue with the enhancer?

aroslanov avatar Feb 08 '24 00:02 aroslanov

We dont have a windows environment at hand. Would greatly appreciate your help in debugging and resolving this via a PR :)

sidroopdaska avatar Feb 08 '24 16:02 sidroopdaska

@aroslanov @sidroopdaska - Check out my fork for the changed I made to get it running in Windows 11 (23H2) / Python 3.10.13. Let me know if anything doesn't make sense (and pardon my notes 😆)

addictivepixels avatar Feb 16 '24 17:02 addictivepixels

I have the same issue on Windows 11

freedave avatar Feb 21 '24 15:02 freedave

We don't have windows environment on hand unfortunately... @freedave did you try @addictivepixels fork?

@addictivepixels could you push a PR for the fix?

vatsalaggarwal avatar Feb 29 '24 22:02 vatsalaggarwal

@aroslanov @sidroopdaska - Check out my fork for the changed I made to get it running in Windows 11 (23H2) / Python 3.10.13. Let me know if anything doesn't make sense (and pardon my notes 😆)

I finally had a chance to try it, Pip crashes on flash-attn install. Inference crashes on NameError: name 'flash_attn_qkvpacked_func' is not defined

aroslanov avatar Mar 02 '24 06:03 aroslanov

@vatsalaggarwal @addictivepixels, I manually installed flash-attn from a wheel to @addictivepixels fork, and now it works like a charm on Windows 11. @addictivepixels, is it possible to open an Issues section in your fork? I would change torch>=2.1.0 to torch==2.1.0 in requirements.txt

aroslanov avatar Mar 02 '24 18:03 aroslanov

@aroslanov Absolutely! Glad you were able to get it working!

@vatsalaggarwal DM me (here or Discord) and I'll provision you a bare-metal Windows environment in my home-lab if you're interested. Connectivity shouldn't be an issue - Symmetrical 5Gbps Fiber connection.

addictivepixels avatar Mar 02 '24 18:03 addictivepixels

@addictivepixels what's your discord? Don't think GitHub has DMs?

Could you upstream your changes as a PR in the meanwhile please, and I can have a look at them / try to get them merged in!

vatsalaggarwal avatar Mar 04 '24 13:03 vatsalaggarwal