Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: must be called with a dataclass type or instance. On Audio Generation Start. #125

Open
Scopule opened this issue Feb 18, 2025 · 1 comment

Comments

@Scopule
Copy link

Scopule commented Feb 18, 2025

Hi, this happens instantly after audio generation starts.\

Full stack:

Traceback (most recent call last):
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\gradio\queueing.py", line 625, in process_events
response = await route_utils.call_process_api(
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\gradio\route_utils.py", line 322, in call_process_api
output = await app.get_blocks().process_api(
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\gradio\blocks.py", line 2098, in process_api
result = await self.call_function(
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\gradio\blocks.py", line 1645, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\anyio_backends_asyncio.py", line 2461, in run_sync_in_worker_thread
return await future
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\anyio_backends_asyncio.py", line 962, in run
result = context.run(func, *args)
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\gradio\utils.py", line 883, in wrapper
response = f(*args, **kwargs)
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows\gradio_interface.py", line 179, in generate_audio
codes = selected_model.generate(
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch\utils_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows\zonos\model.py", line 238, in generate
decode_one_token = torch.compile(decode_one_token, dynamic=True, disable=cg or disable_torch_compile)
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_init_.py", line 2447, in compile
return torch._dynamo.optimize(
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_dynamo\eval_frame.py", line 716, in optimize
return _optimize(rebuild_ctx, *args, **kwargs)
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_dynamo\eval_frame.py", line 790, in optimize
compiler_config=backend.get_compiler_config()
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_init
.py", line 2237, in get_compiler_config
from torch._inductor.compile_fx import get_patched_config_dict
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_inductor\compile_fx.py", line 49, in
from torch._inductor.debug import save_args_for_compile_fx_inner
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_inductor\debug.py", line 26, in from . import config, ir # noqa: F811, this is needed
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_inductor\ir.py", line 77, in
from .runtime.hints import ReductionHint
File "D:\AI Stuff\Zonos V1.0\Zonos-for-windows.venv\lib\site-packages\torch_inductor\runtime\hints.py", line 36, in
attr_desc_fields = {f.name for f in fields(AttrsDescriptor)}
File "C:\Users\Admin\AppData\Roaming\uv\python\cpython-3.10.16-windows-x86_64-none\lib\dataclasses.py", line 1198, in fields
raise TypeError('must be called with a dataclass type or instance') from None

TypeError: must be called with a dataclass type or instance

@rzgarespo
Copy link

Torch-related errors are usually due to your environment configuration, such as package conflicts, incompatible CUDA toolkit versions, path misconfiguration, or issues with the C++ compiler.
To begin with, Python 3.10 supports a version of CUDA that did not work on my PC (RTX3080), so I used Python 3.12 and CUDA 12.6.
To run hybrid models, the script will compile some packages which require your environment to support C++ compilation.
For me, WSL was the easiest way to install it, but it does have some trade-offs. WSL does not work well with VirtualBox or VMware if you plan to run virtual machines or are already running one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants