Skip to content

大佬们,请求http api , inference_sft接口为什么报这个错误呢? #1604

@wei1264610123

Description

@wei1264610123

ERROR: Exception in ASGI application

  • Exception Group Traceback (most recent call last):
    | File "/opt/conda/lib/python3.10/site-packages/uvicorn/protocols/http/h11_impl.py", line 396, in run_asgi
    | result = await app( # type: ignore[func-returns-value]
    | File "/opt/conda/lib/python3.10/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in call
    | return await self.app(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/fastapi/applications.py", line 1054, in call
    | await super().call(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/applications.py", line 113, in call
    | await self.middleware_stack(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/errors.py", line 187, in call
    | raise exc
    | File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/errors.py", line 165, in call
    | await self.app(scope, receive, _send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/cors.py", line 85, in call
    | await self.app(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/middleware/exceptions.py", line 62, in call
    | await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    | raise exc
    | File "/opt/conda/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    | await app(scope, receive, sender)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 715, in call
    | await self.middleware_stack(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 735, in app
    | await route.handle(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 288, in handle
    | await self.app(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 76, in app
    | await wrap_app_handling_exceptions(app, request)(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    | raise exc
    | File "/opt/conda/lib/python3.10/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    | await app(scope, receive, sender)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/routing.py", line 74, in app
    | await response(scope, receive, send)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/responses.py", line 252, in call
    | async with anyio.create_task_group() as task_group:
    | File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 781, in aexit
    | raise BaseExceptionGroup(
    | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    | File "/opt/conda/lib/python3.10/site-packages/starlette/responses.py", line 255, in wrap
    | await func()
    | File "/opt/conda/lib/python3.10/site-packages/starlette/responses.py", line 244, in stream_response
    | async for chunk in self.body_iterator:
    | File "/opt/conda/lib/python3.10/site-packages/starlette/concurrency.py", line 62, in iterate_in_threadpool
    | yield await anyio.to_thread.run_sync(_next, as_iterator)
    | File "/opt/conda/lib/python3.10/site-packages/anyio/to_thread.py", line 56, in run_sync
    | return await get_async_backend().run_sync_in_worker_thread(
    | File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 2485, in run_sync_in_worker_thread
    | return await future
    | File "/opt/conda/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 976, in run
    | result = context.run(func, *args)
    | File "/opt/conda/lib/python3.10/site-packages/starlette/concurrency.py", line 51, in _next
    | return next(iterator)
    | File "/opt/CosyVoice/CosyVoice/runtime/python/fastapi/server.py", line 41, in generate_data
    | for i in model_output:
    | File "/opt/CosyVoice/CosyVoice/runtime/python/fastapi/../../../cosyvoice/cli/cosyvoice.py", line 83, in inference_sft
    | model_input = self.frontend.frontend_sft(i, spk_id)
    | File "/opt/CosyVoice/CosyVoice/runtime/python/fastapi/../../../cosyvoice/cli/frontend.py", line 153, in frontend_sft
    | embedding = self.spk2info[spk_id]['embedding']
    | KeyError: '中文女'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions