facebookresearch / audiocraft

Audiocraft is a library for audio processing and generation with deep learning. It features the state-of-the-art EnCodec audio compressor / tokenizer, along with MusicGen, a simple and controllable music generation LM with textual and melodic conditioning.
MIT License
20.91k stars 2.14k forks source link

ERROR: Exception in ASGI application #154

Closed addarecords closed 1 year ago

addarecords commented 1 year ago

The application seems to build fine on huggingspace but when I try to click "submit" it fails and the log has the following entry:

ERROR: Exception in ASGI application Traceback (most recent call last): File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/uvicorn/protocols/http/h11_impl.py", line 419, in run_asgi result = await app( # type: ignore[func-returns-value] File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/uvicorn/middleware/proxy_headers.py", line 84, in call return await self.app(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/fastapi/applications.py", line 289, in call await super().call(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/applications.py", line 122, in call await self.middleware_stack(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/middleware/errors.py", line 184, in call raise exc File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/middleware/errors.py", line 162, in call await self.app(scope, receive, _send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/middleware/cors.py", line 83, in call await self.app(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 79, in call raise exc File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/middleware/exceptions.py", line 68, in call await self.app(scope, receive, sender) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 20, in call raise e File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/fastapi/middleware/asyncexitstack.py", line 17, in call await self.app(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/routing.py", line 718, in call await route.handle(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/routing.py", line 276, in handle await self.app(scope, receive, send) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/routing.py", line 66, in app response = await func(request) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/fastapi/routing.py", line 273, in app raw_response = await run_endpoint_function( File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/fastapi/routing.py", line 192, in run_endpoint_function return await run_in_threadpool(dependant.call, *values) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/starlette/concurrency.py", line 41, in run_in_threadpool return await anyio.to_thread.run_sync(func, args) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/anyio/to_thread.py", line 33, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread return await future File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 807, in run result = context.run(func, *args) File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/gradio/routes.py", line 289, in api_info return gradio.blocks.get_api_info(config, serialize) # type: ignore File "/home/user/.pyenv/versions/3.9.17/lib/python3.9/site-packages/gradio/blocks.py", line 517, in get_api_info serializer = serializing.COMPONENT_MAPPING[type]() KeyError: 'dataset'

MatteoGauthier commented 1 year ago

Same for me

addarecords commented 1 year ago

I should add that my space on huggingface was previously working just fine. Indeed, I had been using it the previous day with no issues.

At present, I have it up and running on vast.ai instead. So far, so good.

gloic commented 1 year ago

same issue for me, i found a similar issue on A1111 https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/11855#issuecomment-1641254504 pip install gradio_client==0.2.7 worked for me too

addarecords commented 1 year ago

A user on huggingface (Surn) provided a solution for me there.

Edit your Readme.md file sdk: gradio sdk_version: 3.33.1 worked for me, other version likely also work

It is either that or

add to requirements.txt pip>=23.2 gradio_client==0.2

I made both of these changes and it worked like a charm.

tonychan602 commented 1 year ago

Hi there, I got the same situation with you. And I want to follow your instruction to edit the Readme.md file. However, I had find lots of the file which is named Readme.md on the stable diffusion root file and extension files. May I know which Readme.md file do I need to edit for solving the problem? Thank you so much.

A user on huggingface (Surn) provided a solution for me there.

Edit your Readme.md file sdk: gradio sdk_version: 3.33.1 worked for me, other version likely also work It is either that or add to requirements.txt pip>=23.2 gradio_client==0.2

I made both of these changes and it worked like a charm.

addarecords commented 1 year ago

In this case, the Readme.md is specifically this one in the huggingface MusicGen space. In this case, there is metadata that precedes the rest of the usual readme content. Editing that metadata does indeed seem to have an effect when building the project.

I'm afraid I cannot say how this solution might be modified to help with your particular stable diffusion issue.

Hi there, I got the same situation with you. And I want to follow your instruction to edit the Readme.md file. However, I had find lots of the file which is named Readme.md on the stable diffusion root file and extension files. May I know which Readme.md file do I need to edit for solving the problem? Thank you so much.

Asfandyar-Khan-2022 commented 1 year ago

same issue for me, i found a similar issue on A1111 AUTOMATIC1111/stable-diffusion-webui#11855 (comment) pip install gradio_client==0.2.7 worked for me too

This worked for me. Thanks.