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

运行chinese-text-correction-7b模型,出现报错 #528

Open
Jorya2333 opened this issue Oct 29, 2024 · 2 comments
Open

运行chinese-text-correction-7b模型,出现报错 #528

Jorya2333 opened this issue Oct 29, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Jorya2333
Copy link

Describe the bug

环境搭建完成,运行第一遍的时候可以跑出结果。后续就一直运行不出来,一般会卡在下面这个状态中。下面状态提醒是否不用管??
Generating outputs: 0%| | 0/1 [00:00<?, ?it/s]The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask to obtain reliable results.

后续出来的报错情况:
The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's attention_mask to obtain reliable results.
../aten/src/ATen/native/cuda/TensorCompare.cu:110: _assert_async_cuda_kernel: block: [0,0,0], thread: [0,0,0] Assertion probability tensor contains either inf, nan or element < 0 failed.
Generating outputs: 0%| | 0/1 [00:16<?, ?it/s]
Traceback (most recent call last):
File "pycorrector-master/examples/gpt/demo.py", line 30, in
batch_res = m.correct_batch(error_sentences, system_prompt="你是一个中文文本纠错助手。请根据用户提供的原始文本,生成纠正后的文本。")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/pycorrector-master/examples/gpt/../../pycorrector/gpt/gpt_corrector.py", line 73, in correct_batch
corrected_sents = self.predict(
^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pycorrect/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/pycorrector-master/examples/gpt/../../pycorrector/gpt/gpt_model.py", line 575, in predict
outputs = self.model.generate(input_ids, **generation_kwargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pycorrect/lib/python3.12/site-packages/torch/utils/_contextlib.py", line 116, in decorate_context
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pycorrect/lib/python3.12/site-packages/transformers/generation/utils.py", line 2215, in generate
result = self._sample(
^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pycorrect/lib/python3.12/site-packages/transformers/generation/utils.py", line 3195, in _sample
while self._has_unfinished_sequences(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/anaconda3/envs/pycorrect/lib/python3.12/site-packages/transformers/generation/utils.py", line 2413, in _has_unfinished_sequences
elif this_peer_finished:
^^^^^^^^^^^^^^^^^^
RuntimeError: CUDA error: device-side assert triggered
CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect.
For debugging consider passing CUDA_LAUNCH_BLOCKING=1
Compile with TORCH_USE_CUDA_DSA to enable device-side assertions.

@Jorya2333 Jorya2333 added the bug Something isn't working label Oct 29, 2024
@shibing624
Copy link
Owner

机器显存不足,用1.5b的模型。

@Jorya2333
Copy link
Author

机器显存不足,用1.5b的模型。

经过检查,服务器在运行一个消耗很高的程序。非常感谢

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

2 participants