gitmylo / audio-webui

A webui for different audio related Neural Networks
MIT License
973 stars 90 forks source link

[QUESTION] Error When Create New Workspace at train tab #137

Closed tikhonlavrev closed 10 months ago

tikhonlavrev commented 10 months ago

I got this error when I'm trying to create new workspace

Traceback (most recent call last): File "F:\audio-webui\venv\lib\site-packages\gradio\routes.py", line 437, in run_predict output = await app.get_blocks().process_api( File "F:\audio-webui\venv\lib\site-packages\gradio\blocks.py", line 1352, in process_api result = await self.call_function( File "F:\audio-webui\venv\lib\site-packages\gradio\blocks.py", line 1077, in call_function prediction = await anyio.to_thread.run_sync( File "F:\audio-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "F:\audio-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "F:\audio-webui\venv\lib\site-packages\anyio_backends_asyncio.py", line 807, in run result = context.run(func, args) File "F:\audio-webui\webui\ui\tabs\training\rvc.py", line 112, in create_workspace rvc_ws.current_workspace = rvc_ws.RvcWorkspace(name).create({ File "F:\audio-webui\webui\ui\tabs\training\training\rvc_workspace.py", line 66, in create download_base_models(data_in['vsr']) File "F:\audio-webui\webui\ui\tabs\training\training\rvc_workspace.py", line 935, in download_base_models huggingface_hub.hf_hub_download(repo, file, subfolder=sf, File "F:\audio-webui\venv\lib\site-packages\huggingface_hub\utils_validators.py", line 118, in _inner_fn return fn(args, **kwargs) File "F:\audio-webui\venv\lib\site-packages\huggingface_hub\file_download.py", line 1427, in hf_hub_download _check_disk_space(expected_size, local_dir) File "F:\audio-webui\venv\lib\site-packages\huggingface_hub\file_download.py", line 975, in _check_disk_space target_dir_free = shutil.disk_usage(target_dir).free File "C:\Users\tikhonlavrev\AppData\Local\Programs\Python\Python310\lib\shutil.py", line 1341, in disk_usage total, free = nt._getdiskusage(path) FileNotFoundError: [WinError 3] The system cannot find the path specified

Maybe it is bug?, because 2 weeks ago I didn't get this messages

gitmylo commented 10 months ago

I'm not sure what could be causing this, the error looks like it comes from huggingface hub trying to download a file, and checking available disk space first, but something seems to have went wrong.

You could try reinstalling, or simply deleting the venv folder, running the update.bat, then launching the webui again, it will reinstall the packages, and hopefully work this time

d3c0deFPV commented 10 months ago

I'm getting this as well on a fresh install and after running update.bat.

gitmylo commented 10 months ago

Have you tried installing on a different disk? Maybe the partitioning of your F drive is breaking something.

tikhonlavrev commented 10 months ago

Have you tried installing on a different disk? Maybe the partitioning of your F drive is breaking something.

I've tried using C:/, but same result

d3c0deFPV commented 10 months ago

Same, I was using D: but just did a fresh install on C: and I'm getting the same error

  File "C:\audio-webui\venv\lib\site-packages\gradio\routes.py", line 437, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\audio-webui\venv\lib\site-packages\gradio\blocks.py", line 1352, in process_api
    result = await self.call_function(
  File "C:\audio-webui\venv\lib\site-packages\gradio\blocks.py", line 1077, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\audio-webui\venv\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\audio-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\audio-webui\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\audio-webui\webui\ui\tabs\training\rvc.py", line 112, in create_workspace
    rvc_ws.current_workspace = rvc_ws.RvcWorkspace(name).create({
  File "C:\audio-webui\webui\ui\tabs\training\training\rvc_workspace.py", line 66, in create
    download_base_models(data_in['vsr'])
  File "C:\audio-webui\webui\ui\tabs\training\training\rvc_workspace.py", line 935, in download_base_models
    huggingface_hub.hf_hub_download(repo, file, subfolder=sf,
  File "C:\audio-webui\venv\lib\site-packages\huggingface_hub\utils\_validators.py", line 118, in _inner_fn
    return fn(*args, **kwargs)
  File "C:\audio-webui\venv\lib\site-packages\huggingface_hub\file_download.py", line 1427, in hf_hub_download
    _check_disk_space(expected_size, local_dir)
  File "C:\audio-webui\venv\lib\site-packages\huggingface_hub\file_download.py", line 975, in _check_disk_space
    target_dir_free = shutil.disk_usage(target_dir).free
  File "C:\Python310\lib\shutil.py", line 1341, in disk_usage
    total, free = nt._getdiskusage(path)
FileNotFoundError: [WinError 3] The system cannot find the path specified
tikhonlavrev commented 10 months ago

I'm not sure what could be causing this, the error looks like it comes from huggingface hub trying to download a file, and checking available disk space first, but something seems to have went wrong.

You could try reinstalling, or simply deleting the venv folder, running the update.bat, then launching the webui again, it will reinstall the packages, and hopefully work this time

I've tried this too, Same error after reinstalling the and run update.bat

gitmylo commented 10 months ago

It might have been caused by huggingface-hub updating yesterday.

https://pypi.org/project/huggingface-hub/#history

I will lock the requirement to 0.17.1 (before yesterday's update), this should work

gitmylo commented 10 months ago

I have just pushed a commit which could fix this issue, please update me on if it fixes this issue.

d3c0deFPV commented 10 months ago

No change after pulling 7f84d19

Currently working around it by removing the disk space check on line 1427. The checks above it using the same function don't seem to error out.

tikhonlavrev commented 10 months ago

I have just pushed a commit which could fix this issue, please update me on if it fixes this issue.

Same error still happened

d3c0deFPV commented 10 months ago

Something that may be obvious but worth noting is that after working around that and the download completes I can remove the workaround and there are no issues.

So you may not see it on anything but a fresh install or on a system where this hasn't been downloaded yet.

gitmylo commented 10 months ago

I will attempt to reproduce it, but since i'm on linux, and don't have quick access to a windows machine, i'm not sure if i can reproduce it, but we'll see.

gitmylo commented 10 months ago

I have an idea for a fix, i could monkeypatch _check_disk_space() on line 964 in huggingface-hub's file_download.py to keep the original function, but add a try catch around it. so it won't crash, a bit of a hacky fix, but it should do it.

gitmylo commented 10 months ago

Alright, i've pushed that change, it shouldn't crash anymore now.

d3c0deFPV commented 10 months ago

Workaround works. I was able to download without the error after clearing cache. Thanks!