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

error occurs: INTERNAL SERVER ERROR #263

Open
hugh123456789 opened this issue Dec 10, 2024 · 3 comments
Open

error occurs: INTERNAL SERVER ERROR #263

hugh123456789 opened this issue Dec 10, 2024 · 3 comments

Comments

@hugh123456789
Copy link

linux执行报错,这是为啥呀
ERROR in app: Exception on /tts [POST]
Traceback (most recent call last):
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/app/app.py", line 264, in tts
wavs = chat.infer(
File "/app/ChatTTS/core.py", line 233, in infer
return next(res_gen)
File "/app/ChatTTS/core.py", line 386, in _infer
for result in self._infer_code(
File "/home/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/ChatTTS/core.py", line 511, in _infer_code
input_ids, attention_mask, text_mask = self.tokenizer.encode(
File "/home/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/ChatTTS/model/tokenizer.py", line 59, in encode
x = self._tokenizer.encode_plus(
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 3037, in encode_plus
padding_strategy, truncation_strategy, max_length, kwargs = self._get_padding_truncation_strategies(
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 2761, in _get_padding_truncation_strategies
if padding_strategy != PaddingStrategy.DO_NOT_PAD and (self.pad_token is None or self.pad_token_id < 0):
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1104, in getattr
raise AttributeError(f"{self.class.name} has no attribute {key}")
AttributeError: BertTokenizerFast has no attribute pad_token

@hugh123456789
Copy link
Author

完整报错
{'sha256_asset_Decoder_pt': '9964e36e840f0e3a748c5f716fe6de6490d2135a5f5155f4a642d51860e2ec38', 'sha256_asset_DVAE_full_pt': '553eb75763511e23f3e5f86303e2163c5ca775489d637fb635d979c8ae58bbe5', 'sha256_asset_GPT_pt': 'd7d4ee6461ea097a2be23eb40d73fb94ad3b3d39cb64fbb50cb3357fd466cadb', 'sha256_asset_spk_stat_pt': '3228d8a4cbbf349d107a1b76d2f47820865bd3c9928c4bdfe1cefd5c7071105f', 'sha256_asset_tokenizer_pt': 'e911ae7c6a7c27953433f35c44227a67838fe229a1f428503bdb6cd3d1bcc69c', 'sha256_asset_Vocos_pt': '09a670eda1c08b740013679c7a90ebb7f1a97646ea7673069a6838e6b51d6c58'}
no GPU found, use CPU instead
Start:0.0.0.0:9966
voice='3333.pt'
当前使用音色 seed_path='/app/speaker/3333.pt'
prompt='[break_6]'
te=['除文本框必填外,其他均为可选,若不懂无需填写 [uv_break] ']
[2024-12-10 01:39:21,033] ERROR in app: Exception on /tts [POST]
Traceback (most recent call last):
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/app/app.py", line 264, in tts
wavs = chat.infer(
File "/app/ChatTTS/core.py", line 233, in infer
return next(res_gen)
File "/app/ChatTTS/core.py", line 386, in _infer
for result in self._infer_code(
File "/home/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/ChatTTS/core.py", line 511, in _infer_code
input_ids, attention_mask, text_mask = self.tokenizer.encode(
File "/home/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/ChatTTS/model/tokenizer.py", line 59, in encode
x = self._tokenizer.encode_plus(
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 3037, in encode_plus
padding_strategy, truncation_strategy, max_length, kwargs = self._get_padding_truncation_strategies(
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 2761, in _get_padding_truncation_strategies
if padding_strategy != PaddingStrategy.DO_NOT_PAD and (self.pad_token is None or self.pad_token_id < 0):
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1104, in getattr
raise AttributeError(f"{self.class.name} has no attribute {key}")
AttributeError: BertTokenizerFast has no attribute pad_token
ERROR:app:Exception on /tts [POST]
Traceback (most recent call last):
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 1511, in wsgi_app
response = self.full_dispatch_request()
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 919, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 917, in full_dispatch_request
rv = self.dispatch_request()
File "/home/venv/lib/python3.9/site-packages/flask/app.py", line 902, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) # type: ignore[no-any-return]
File "/app/app.py", line 264, in tts
wavs = chat.infer(
File "/app/ChatTTS/core.py", line 233, in infer
return next(res_gen)
File "/app/ChatTTS/core.py", line 386, in _infer
for result in self._infer_code(
File "/home/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/ChatTTS/core.py", line 511, in _infer_code
input_ids, attention_mask, text_mask = self.tokenizer.encode(
File "/home/venv/lib/python3.9/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
return func(*args, **kwargs)
File "/app/ChatTTS/model/tokenizer.py", line 59, in encode
x = self._tokenizer.encode_plus(
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 3037, in encode_plus
padding_strategy, truncation_strategy, max_length, kwargs = self._get_padding_truncation_strategies(
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 2761, in _get_padding_truncation_strategies
if padding_strategy != PaddingStrategy.DO_NOT_PAD and (self.pad_token is None or self.pad_token_id < 0):
File "/home/venv/lib/python3.9/site-packages/transformers/tokenization_utils_base.py", line 1104, in getattr
raise AttributeError(f"{self.class.name} has no attribute {key}")
AttributeError: BertTokenizerFast has no attribute pad_token

@FrankSWP
Copy link

尝试一下,transformers的版本使用4.41.2

@hugh123456789
Copy link
Author

尝试一下,transformers的版本使用4.41.2

可以了,感谢大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants