xtts-api-server icon indicating copy to clipboard operation
xtts-api-server copied to clipboard

streaming not working with pipy install, but working with docker

Open Eve-146T opened this issue 1 year ago • 0 comments

Streaming does work with docker compose, but not with pipy install.

Solution: Ignore the problem and add a warning to the readme.

Full error:

2024-09-29 09:59:19.193 | INFO     | xtts_api_server.tts_funcs:get_or_create_latents:259 - creating latents for annie: speakers/annie.wav
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/responses.py", line 257, in __call__
    await wrap(partial(self.listen_for_disconnect, receive))
  File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/responses.py", line 253, in wrap
    await func()
  File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/responses.py", line 230, in listen_for_disconnect
    message = await receive()
              ^^^^^^^^^^^^^^^
  File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 534, in receive
    await self.message_event.wait()
  File "/home/user1/anaconda3/lib/python3.12/asyncio/locks.py", line 212, in wait
    await fut
asyncio.exceptions.CancelledError: Cancelled by cancel scope 7fdbeb2bbd40

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
  |     result = await app(  # type: ignore[func-returns-value]
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
  |     return await self.app(scope, receive, send)
  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
  |     await super().__call__(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
  |     raise exc
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
  |     await self.app(scope, receive, _send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
  |     await self.app(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
  |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
  |     raise exc
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
  |     await self.middleware_stack(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
  |     await route.handle(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
  |     await self.app(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
  |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 62, in wrapped_app
  |     raise exc
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 51, in wrapped_app
  |     await app(scope, receive, sender)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
  |     await response(scope, receive, send)
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/responses.py", line 250, in __call__
  |     async with anyio.create_task_group() as task_group:
  |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 736, in __aexit__
  |     raise BaseExceptionGroup(
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/responses.py", line 253, in wrap
    |     await func()
    |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/starlette/responses.py", line 242, in stream_response
    |     async for chunk in self.body_iterator:
    |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/xtts_api_server/server.py", line 244, in generator
    |     async for chunk in chunks:
    |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/xtts_api_server/tts_funcs.py", line 591, in stream_fn
    |     async for chunk in self.stream_generation(clear_text,speaker_name_or_path,speaker_wav,language,output_file):
    |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/xtts_api_server/tts_funcs.py", line 456, in stream_generation
    |     gpt_cond_latent, speaker_embedding = self.get_or_create_latents(speaker_name, speaker_wav)
    |                                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/home/user1/gits/xtts-api/xtts_venv/lib/python3.12/site-packages/xtts_api_server/tts_funcs.py", line 260, in get_or_create_latents
    |     gpt_cond_latent, speaker_embedding = self.model.get_conditioning_latents(speaker_wav)
    |                                          ^^^^^^^^^^
    | AttributeError: 'TTSWrapper' object has no attribute 'model'
    +------------------------------------

Eve-146T avatar Sep 29 '24 07:09 Eve-146T