2noise / ChatTTS

A generative speech model for daily dialogue.
https://2noise.com
GNU Affero General Public License v3.0
32.58k stars 3.53k forks source link

AttributeError: 'Chat' object has no attribute 'gpt'如何决解 #565

Open kustcl opened 4 months ago

kustcl commented 4 months ago

Traceback (most recent call last): File "D:\anaconda\Lib\site-packages\gradio\queueing.py", line 541, in process_events response = await route_utils.call_process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\gradio\route_utils.py", line 276, in call_process_api output = await app.get_blocks().process_api( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\gradio\blocks.py", line 1928, in process_api result = await self.call_function( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\gradio\blocks.py", line 1514, in call_function prediction = await anyio.to_thread.run_sync( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\anyio\to_thread.py", line 56, in run_sync return await get_async_backend().run_sync_in_worker_thread( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\anyio_backends_asyncio.py", line 2134, in run_sync_in_worker_thread return await future ^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\anyio_backends_asyncio.py", line 851, in run result = context.run(func, args) ^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\gradio\utils.py", line 833, in wrapper response = f(args, **kwargs) ^^^^^^^^^^^^^^^^^^ File "D:\python\python代码\pythonProject大模型调用\chatbot.py", line 54, in generate_audio rand_spk = chat.sample_random_speaker() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\ChatTTS\core.py", line 162, in sample_random_speaker return self._encode_spk_emb(self._sample_random_speaker()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\anaconda\Lib\site-packages\ChatTTS\core.py", line 182, in _sample_random_speaker dim: int = self.gpt.gpt.layers[0].mlp.gate_proj.in_features ^^^^^^^^ AttributeError: 'Chat' object has no attribute 'gpt'

Mengjintao commented 4 months ago

pip install chattts can fix this issue.

fumiama commented 4 months ago

尝试同步最新代码

JimmyZhangJW commented 4 months ago

Did you run chat.load() ?

sb-bai commented 1 month ago

请问 问题解决了嘛

sb-bai commented 1 month ago
^^^^^^^^^^^^^^^^^

File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/core/model.py", line 401, in _call_wrapper_binary return await self._call_wrapper("binary", fn, *args, kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/core/model.py", line 114, in _async_wrapper return await fn(*args, *kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/core/model.py", line 415, in _call_wrapper ret = await asyncio.to_thread(fn, args, kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/asyncio/threads.py", line 25, in to_thread return await loop.run_in_executor(None, func_call) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/model/audio/chattts.py", line 73, in speech rnd_spk_emb = self._model.sample_random_speaker() ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/ChatTTS/core.py", line 160, in sample_random_speaker return self.speaker.sample_random() ^^^^^^^^^^^^^^^^^ AttributeError: [address=0.0.0.0:44655, pid=937127] 'Chat' object has no attribute 'speaker' 我遇到了类似的问题

sheepying commented 1 month ago
^^^^^^^^^^^^^^^^^

File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/core/model.py", line 401, in _call_wrapper_binary return await self._call_wrapper("binary", fn, *args, kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/core/model.py", line 114, in _async_wrapper return await fn(*args, *kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/core/model.py", line 415, in _call_wrapper ret = await asyncio.to_thread(fn, args, kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/asyncio/threads.py", line 25, in to_thread return await loop.run_in_executor(None, func_call) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/xinference/model/audio/chattts.py", line 73, in speech rnd_spk_emb = self._model.sample_random_speaker() ^^^^^^^^^^^^^^^^^ File "/mnt/mydata/Anaconda3/envs/xference/lib/python3.11/site-packages/ChatTTS/core.py", line 160, in sample_random_speaker return self.speaker.sample_random() ^^^^^^^^^^^^^^^^^ AttributeError: [address=0.0.0.0:44655, pid=937127] 'Chat' object has no attribute 'speaker' 我遇到了类似的问题

我遇到了和你相同的问题:Traceback (most recent call last): File "/app/api/.venv/lib/python3.10/site-packages/gunicorn/workers/base_async.py", line 55, in handle self.handle_request(listener_name, req, client, addr) File "/app/api/.venv/lib/python3.10/site-packages/gunicorn/workers/ggevent.py", line 128, in handle_request super().handle_request(listener_name, req, sock, addr) File "/app/api/.venv/lib/python3.10/site-packages/gunicorn/workers/base_async.py", line 115, in handle_request for item in respiter: File "/app/api/.venv/lib/python3.10/site-packages/werkzeug/wsgi.py", line 256, in next return self._next() File "/app/api/.venv/lib/python3.10/site-packages/werkzeug/wrappers/response.py", line 32, in _iter_encoded for item in iterable: File "/app/api/.venv/lib/python3.10/site-packages/flask/helpers.py", line 113, in generator yield from gen File "/app/api/core/model_runtime/model_providers/xinference/tts/tts.py", line 247, in _tts_invoke_streaming raise InvokeBadRequestError(str(ex)) core.model_runtime.errors.invoke.InvokeBadRequestError: Failed to speech the text, detail: [address=0.0.0.0:35231, pid=44541] 'Chat' object has no attribute 'speaker' 请问你解决了吗