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

[BUG:WebUI] 点击Web页面上的“生成单频”按钮后报错 #154

Open
3 tasks done
haijd opened this issue Sep 12, 2024 · 6 comments
Open
3 tasks done

[BUG:WebUI] 点击Web页面上的“生成单频”按钮后报错 #154

haijd opened this issue Sep 12, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@haijd
Copy link

haijd commented Sep 12, 2024

确认清单

  • 我已经阅读过 README.md 和 dependencies.md 文件
  • 我已经确认之前没有 issue 或 discussion 涉及此 BUG
  • 我已经确认问题发生在最新代码或稳定版本中

Forge Commit 或者 Tag

4d9d671

Python 版本

3.11.9

PyTorch 版本

2.3.1+cu121

操作系统信息

ubuntu 24.04

浏览器信息

No response

BUG 描述

点击Web页面上的“生成单频”按钮后没有生成音频,Web页面和终端都报错。

复现步骤

点击Web页面上的“生成单频”按钮

期望结果

生成音频

实际结果

Web页面上提示错误,终端报错

错误信息

Web页面上提示错误:

error
Connection errored out. 

终端中的错误信息:

ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/type_adapter.py", line 270, in _init_core_attrs
    self._core_schema = _getattr_no_parents(self._type, '__pydantic_core_schema__')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/type_adapter.py", line 112, in _getattr_no_parents
    raise AttributeError(attribute)
AttributeError: __pydantic_core_schema__

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/middleware/errors.py", line 187, in __call__
    raise exc
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/middleware/errors.py", line 165, in __call__
    await self.app(scope, receive, _send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/middleware/cors.py", line 93, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/middleware/cors.py", line 144, in simple_response
    await self.app(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/routing.py", line 715, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/routing.py", line 735, in app
    await route.handle(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/routing.py", line 288, in handle
    await self.app(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/routing.py", line 76, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
    raise exc
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
    await app(scope, receive, sender)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/routing.py", line 291, in app
    solved_result = await solve_dependencies(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 639, in solve_dependencies
    ) = await request_body_to_args(  # body_params checked above
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/dependencies/utils.py", line 813, in request_body_to_args
    fields_to_extract = get_cached_model_fields(first_field.type_)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/_compat.py", line 657, in get_cached_model_fields
    return get_model_fields(model)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/_compat.py", line 284, in get_model_fields
    return [
           ^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/_compat.py", line 285, in <listcomp>
    ModelField(field_info=field_info, name=name)
  File "<string>", line 6, in __init__
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/fastapi/_compat.py", line 110, in __post_init__
    self._type_adapter: TypeAdapter[Any] = TypeAdapter(
                                           ^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/type_adapter.py", line 257, in __init__
    self._init_core_attrs(rebuild_mocks=False)
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/type_adapter.py", line 135, in wrapped
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/type_adapter.py", line 277, in _init_core_attrs
    self._core_schema = _get_schema(self._type, config_wrapper, parent_depth=self._parent_depth)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/type_adapter.py", line 95, in _get_schema
    schema = gen.generate_schema(type_)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 908, in _generate_schema_inner
    return self._annotated_schema(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2028, in _annotated_schema
    schema = self._apply_annotations(source_type, annotations)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2107, in _apply_annotations
    schema = get_inner_schema(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
    schema = self._handler(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2189, in new_handler
    schema = metadata_get_schema(source, get_inner_schema)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2185, in <lambda>
    lambda source, handler: handler(source)
                            ^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_schema_generation_shared.py", line 83, in __call__
    schema = self._handler(source_type)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 2088, in inner_handler
    schema = self._generate_schema_inner(obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
           ^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1029, in match_type
    return self._match_generic_type(obj, origin)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1058, in _match_generic_type
    return self._union_schema(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1378, in _union_schema
    choices.append(self.generate_schema(arg))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 655, in generate_schema
    schema = self._generate_schema_inner(obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 929, in _generate_schema_inner
    return self.match_type(obj)
           ^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 1038, in match_type
    return self._unknown_type_schema(obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/srv/workspace/py311-chattts/lib/python3.11/site-packages/pydantic/_internal/_generate_schema.py", line 558, in _unknown_type_schema
    raise PydanticSchemaGenerationError(
pydantic.errors.PydanticSchemaGenerationError: Unable to generate pydantic-core schema for <class 'starlette.requests.Request'>. Set `arbitrary_types_allowed=True` in the model_config to ignore this error or implement `__get_pydantic_core_schema__` on your type to fully support it.

If you got this error by calling handler(<some type>) within `__get_pydantic_core_schema__` then you likely need to call `handler.generate_schema(<some type>)` since we do not call `__get_pydantic_core_schema__` on `<some type>` otherwise to avoid infinite recursion.

For further information visit https://errors.pydantic.dev/2.9/u/schema-for-unknown-type
@haijd haijd added the bug Something isn't working label Sep 12, 2024
@zhzLuke96
Copy link
Member

无法复现
建议尝试更新相关依赖版本

或者提供更多信息方便我们定位问题
比如
你的运行环境里 fastapi / pydantic / gradio 这几个包的版本号是多少?

@haijd
Copy link
Author

haijd commented Sep 14, 2024

以下是我安装的Python包:

Package                   Version
------------------------- --------------
absl-py                   2.1.0
aiofiles                  23.2.1
aiohappyeyeballs          2.4.0
aiohttp                   3.10.5
aiosignal                 1.3.1
alembic                   1.13.2
annotated-types           0.7.0
antlr4-python3-runtime    4.9.3
anyio                     4.4.0
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-lru                 2.0.4
attrs                     24.2.0
audioread                 3.0.1
autopage                  0.5.2
av                        12.3.0
babel                     2.16.0
beautifulsoup4            4.12.3
bleach                    6.1.0
blinker                   1.8.2
cachetools                5.5.0
cdifflib                  1.2.6
certifi                   2024.8.30
cffi                      1.17.1
cfgv                      3.4.0
charset-normalizer        3.3.2
click                     8.1.7
cliff                     4.7.0
clldutils                 3.21.0
cmaes                     0.11.1
cmd2                      2.4.3
cn2an                     0.5.22
colorama                  0.4.6
coloredlogs               15.0.1
colorlog                  6.8.2
comm                      0.2.2
conformer                 0.3.2
contourpy                 1.3.0
csvw                      3.3.1
ctranslate2               4.4.0
cycler                    0.12.1
cython                    3.0.11
debugpy                   1.8.5
decorator                 5.1.1
defusedxml                0.7.1
diffusers                 0.25.0
distlib                   0.3.8
dlinfo                    1.2.1
docker-pycreds            0.4.0
editdistance              0.8.1
einops                    0.8.0
einx                      0.3.0
emojiswitch               0.0.3
encodec                   0.1.1
eng-to-ipa                0.0.2
executing                 2.1.0
fastapi                   0.114.1
faster-whisper            1.0.3
fastjsonschema            2.20.0
ffmpy                     0.4.0
filelock                  3.16.0
flask                     3.0.3
flatbuffers               24.3.25
fonttools                 4.53.1
fqdn                      1.5.1
frozendict                2.4.4
frozenlist                1.4.1
fsspec                    2024.9.0
ftfy                      6.2.3
gdown                     5.2.0
gitdb                     4.0.11
gitpython                 3.1.43
gradio                    4.39.0
gradio-client             1.1.1
greenlet                  3.1.0
grpcio                    1.66.1
h11                       0.14.0
httpcore                  1.0.5
httpx                     0.27.2
huggingface-hub           0.24.6
humanfriendly             10.0
hydra-colorlog            1.2.0
hydra-core                1.3.2
hydra-optuna-sweeper      1.2.0
hyperpyyaml               1.2.2
identify                  2.6.0
idna                      3.8
importlib-metadata        8.4.0
importlib-resources       6.4.5
inflect                   7.4.0
iniconfig                 2.0.0
ipykernel                 6.29.5
ipython                   8.27.0
ipywidgets                8.1.5
isodate                   0.6.1
isoduration               20.11.0
itsdangerous              2.2.0
jedi                      0.19.1
jieba                     0.42.1
jinja2                    3.1.4
joblib                    1.4.2
json5                     0.9.25
jsonpointer               3.0.0
jsonschema                4.23.0
jsonschema-specifications 2023.12.1
jupyter-client            8.6.2
jupyter-core              5.7.2
jupyter-events            0.10.0
jupyter-lsp               2.2.5
jupyter-server            2.14.2
jupyter-server-terminals  0.5.3
jupyterlab                4.2.5
jupyterlab-pygments       0.3.0
jupyterlab-server         2.27.3
jupyterlab-widgets        3.0.13
kiwisolver                1.4.7
langdetect                1.0.9
language-tags             1.2.0
lazy-loader               0.4
librosa                   0.10.2.post1
lightning                 2.4.0
lightning-utilities       0.11.7
llvmlite                  0.43.0
loguru                    0.7.2
loralib                   0.1.2
lxml                      5.3.0
mako                      1.3.5
markdown                  3.7
markdown-it-py            3.0.0
markupsafe                2.1.5
matcha-tts                0.0.5.1
matplotlib                3.9.2
matplotlib-inline         0.1.7
mdurl                     0.1.2
mistune                   3.0.2
modelscope                1.18.0
more-itertools            10.5.0
mpmath                    1.3.0
msgpack                   1.1.0
multidict                 6.1.0
natsort                   8.4.0
nbclient                  0.10.0
nbconvert                 7.16.4
nbformat                  5.10.4
nemo-text-processing      1.0.2
nest-asyncio              1.6.0
networkx                  3.3
nodeenv                   1.9.1
notebook                  7.2.2
notebook-shim             0.2.4
numba                     0.60.0
numpy                     1.26.4
nvidia-cublas-cu12        12.1.3.1
nvidia-cuda-cupti-cu12    12.1.105
nvidia-cuda-nvrtc-cu12    12.1.105
nvidia-cuda-runtime-cu12  12.1.105
nvidia-cudnn-cu12         8.9.2.26
nvidia-cufft-cu12         11.0.2.54
nvidia-curand-cu12        10.3.2.106
nvidia-cusolver-cu12      11.4.5.107
nvidia-cusparse-cu12      12.1.0.106
nvidia-nccl-cu12          2.20.5
nvidia-nvjitlink-cu12     12.4.99
nvidia-nvtx-cu12          12.1.105
omegaconf                 2.3.0
onnxruntime               1.19.2
openai-whisper            20231117
optuna                    2.10.1
orjson                    3.10.7
overrides                 7.7.0
packaging                 24.1
pandas                    2.2.2
pandocfilters             1.5.1
parso                     0.8.4
pbr                       6.1.0
pexpect                   4.9.0
phonemizer                3.3.0
pillow                    10.4.0
piper-phonemize           1.1.0
platformdirs              4.3.2
pluggy                    1.5.0
pooch                     1.8.2
pre-commit                3.8.0
prettytable               3.11.0
proces                    0.1.7
prometheus-client         0.20.0
prompt-toolkit            3.0.47
protobuf                  5.28.0
psutil                    6.0.0
ptyprocess                0.7.0
pure-eval                 0.2.3
pybase16384               0.3.7
pycparser                 2.22
pydantic                  2.9.1
pydantic-core             2.23.3
pydub                     0.25.1
pygments                  2.18.0
pylatexenc                2.10
pynini                    2.1.5
pyparsing                 3.1.4
pyperclip                 1.9.0
pypinyin                  0.52.0
pyrootutils               1.0.4
pyrubberband              0.3.0
pysocks                   1.7.1
pysoundfile               0.9.0.post1
pysubs2                   1.7.3
pytest                    8.3.3
python-box                7.2.0
python-dateutil           2.9.0.post0
python-dotenv             1.0.1
python-json-logger        2.0.7
python-ms                 1.1.0
python-multipart          0.0.9
pytorch-lightning         2.4.0
pytz                      2024.2
pyyaml                    6.0.2
pyzmq                     26.2.0
rdflib                    7.0.0
referencing               0.35.1
regex                     2024.7.24
requests                  2.32.3
rfc3339-validator         0.1.4
rfc3986                   1.5.0
rfc3986-validator         0.1.1
rich                      13.8.1
rootutils                 1.0.7
rpds-py                   0.20.0
ruamel-yaml               0.18.6
ruamel-yaml-clib          0.2.8
ruff                      0.6.4
sacremoses                0.1.1
safetensors               0.4.5
scikit-learn              1.5.1
scipy                     1.14.1
seaborn                   0.13.2
segments                  2.2.1
semantic-version          2.10.0
send2trash                1.8.3
sentry-sdk                2.14.0
setproctitle              1.3.3
setuptools                74.1.2
shellingham               1.5.4
six                       1.16.0
smmap                     5.0.1
sniffio                   1.3.1
soundfile                 0.12.1
soupsieve                 2.6
soxr                      0.5.0.post1
sqlalchemy                2.0.34
stack-data                0.6.3
starlette                 0.38.5
stevedore                 5.3.0
sympy                     1.13.2
tabulate                  0.9.0
tensorboard               2.17.1
tensorboard-data-server   0.7.2
terminado                 0.18.1
threadpoolctl             3.5.0
tiktoken                  0.7.0
tinycss2                  1.3.0
tokenizers                0.19.1
tomlkit                   0.12.0
torch                     2.3.1
torchaudio                2.3.1
torchmetrics              1.4.1
torchvision               0.18.1
tornado                   6.4.1
tqdm                      4.66.5
traitlets                 5.14.3
transformer-engine        1.10.0
transformer-engine-cu12   1.10.0
transformers              4.41.2
triton                    2.3.1
typeguard                 4.3.0
typer                     0.12.5
types-python-dateutil     2.9.0.20240906
typing-extensions         4.12.2
tzdata                    2024.1
unidecode                 1.3.8
uri-template              1.3.0
uritemplate               4.1.1
urllib3                   2.2.2
uvicorn                   0.30.6
vector-quantize-pytorch   1.17.3
virtualenv                20.26.4
vocos                     0.1.0
waitress                  3.0.0
wandb                     0.17.9
wcwidth                   0.2.13
webcolors                 24.8.0
webencodings              0.5.1
websocket-client          1.8.0
websockets                11.0.3
werkzeug                  3.0.4
wetextprocessing          1.0.3
wget                      3.2
widgetsnbextension        4.0.13
wrapt                     1.16.0
yarl                      1.11.1
zhon                      2.0.2
zipp                      3.20.1

我刚开始用的是Python 12,后来切换成了Python 11,但问题依然存在。

@ccjaread
Copy link

我在macOS下同样有这个错误,最后升级了gradio到最新版解决了,供参考 pip install --upgrade gradio

@haijd
Copy link
Author

haijd commented Sep 16, 2024

我在macOS下同样有这个错误,最后升级了gradio到最新版解决了,供参考 pip install --upgrade gradio

感谢帮助,把gradio升级到4.44.0版后,没有这个问题了

@yecol
Copy link

yecol commented Sep 18, 2024

无法复现 建议尝试更新相关依赖版本

或者提供更多信息方便我们定位问题 比如 你的运行环境里 fastapi / pydantic / gradio 这几个包的版本号是多少?

Simply reproducible by running the colab provided in README:
It crashed when uploading a voice style json file.

But yes, upgrade gradio can solve this problem.

@zhzLuke96
Copy link
Member

无法复现 建议尝试更新相关依赖版本
或者提供更多信息方便我们定位问题 比如 你的运行环境里 fastapi / pydantic / gradio 这几个包的版本号是多少?

Simply reproducible by running the colab provided in README: It crashed when uploading a voice style json file.

But yes, upgrade gradio can solve this problem.

感谢反馈,colab确实可以复现

fixed e071063
我已经将 gradio 版本固定到 4.44.0

但是,其实我还是没在本地复现出问题所在的位置,可能并非 gradio 版本导致的,所以这个 issue 将会 reopen,如果还有类似的情况可以继续在这个 issue 下面讨论

@zhzLuke96 zhzLuke96 reopened this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants