-
Notifications
You must be signed in to change notification settings - Fork 350
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
Timestamp error may caused by audio file. #173
Labels
bug
Something isn't working
Comments
funasr最新main分支安装,环境如下: torch 2.4.0
funasr 1.2.2 /mnt/workspace/FunASR cuda版本:
Into+the+Uncut+Grass+-+Trevor+Noah.mp3,音频格式:
without time_stamp,推理正常,测试代码如下: from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
model_dir = "iic/SenseVoiceSmall"
model = AutoModel(
model=model_dir,
vad_model="fsmn-vad",
vad_kwargs={"max_single_segment_time": 30000},
device="cuda:0",
)
# en
res = model.generate(
input=f"/mnt/workspace/Into+the+Uncut+Grass+-+Trevor+Noah.mp3",
cache={},
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
use_itn=True,
batch_size_s=60,
merge_vad=True, #
merge_length_s=15,
)
text = rich_transcription_postprocess(res[0]["text"])
print(text) with time_stamp,报错如下:
测试代码如下: from funasr import AutoModel
from funasr.utils.postprocess_utils import rich_transcription_postprocess
model_dir = "iic/SenseVoiceSmall"
model = AutoModel(
model=model_dir,
vad_model="fsmn-vad",
vad_kwargs={"max_single_segment_time": 30000},
device="cuda:0",
)
# en with timestamp
res = model.generate(
input=f"/mnt/workspace/Into+the+Uncut+Grass+-+Trevor+Noah.mp3",
cache={},
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
use_itn=True,
batch_size_s=60,
merge_vad=True, #
merge_length_s=15,
output_timestamp=True,
)
print(res)
text = rich_transcription_postprocess(res[0]["text"])
print(text) |
感谢反馈 我来修一下 |
您好,请问修好了吗?或者有什么work around吗 |
res = model.generate(
input=f"D:\AI\SenseVoice\example\第88章.mp3",
cache={},
language="auto", # "zh", "en", "yue", "ja", "ko", "nospeech"
use_itn=True,
batch_size_s=60,
merge_vad=False, #
merge_length_s=15,
output_timestamp=True
) 只要 output_timestamp=True 就会报错,请问修复了吗? |
Same issue. |
同问 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)
🐛 Bug
Run timestamp error
To Reproduce
funasr version: 1.2.0.
Downloading Model to directory: C:\Users\huowuge.cache\modelscope\hub\iic/SenseVoiceSmall
2024-12-21 22:49:58,457 - modelscope - WARNING - Using branch: master as version is unstable, use with caution
Downloading Model to directory: C:\Users\huowuge.cache\modelscope\hub\iic/speech_fsmn_vad_zh-cn-16k-common-pytorch
2024-12-21 22:50:01,588 - modelscope - WARNING - Using branch: master as version is unstable, use with caution
Downloading Model to directory: C:\Users\huowuge.cache\modelscope\hub\iic/punc_ct-transformer_cn-en-common-vocab471067-large
2024-12-21 22:50:02,127 - modelscope - WARNING - Using branch: master as version is unstable, use with caution
Building prefix dict from the default dictionary ...
DEBUG:jieba:Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\huowuge\AppData\Local\Temp\jieba.cache
DEBUG:jieba:Loading model from cache C:\Users\huowuge\AppData\Local\Temp\jieba.cache
Loading model cost 0.591 seconds.
DEBUG:jieba:Loading model cost 0.591 seconds.
Prefix dict has been built successfully.
DEBUG:jieba:Prefix dict has been built successfully.
rtf_avg: 6.220: 100%|██████████| 1/1 [00:12<00:00, 12.07s/it]
0%| | 0/1 [00:00<?, ?it/s]
0%| | 0/9 [00:00<?, ?it/s]C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [1,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [2,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [3,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [4,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [5,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [6,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [7,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.C:\actions-runner_work\pytorch\pytorch\builder\windows\pytorch\aten\src\ATen\native\cuda\IndexKernel.cu:92: block: [0,0,0], thread: [8,0,0] Assertion
-sizes[i] <= index && index < sizes[i] && "index out of bounds"
failed.Traceback (most recent call last):
File "D:\projects\funasr\asr_en\asr.py", line 19, in
res = model.generate(
^^^^^^^^^^^^^^^
File "D:\projects\funasr.venv\Lib\site-packages\funasr\auto\auto_model.py", line 304, in generate
return self.inference_with_vad(input, input_len=input_len, **cfg)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\projects\funasr.venv\Lib\site-packages\funasr\auto\auto_model.py", line 458, in inference_with_vad
results = self.inference(
^^^^^^^^^^^^^^^
File "D:\projects\funasr.venv\Lib\site-packages\funasr\auto\auto_model.py", line 343, in inference
res = model.inference(**batch, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\projects\funasr.venv\Lib\site-packages\funasr\models\sense_voice\model.py", line 932, in inference
pred = groupby(align[0, : encoder_out_lens[0]])
~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
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.0%| | 0/9 [00:02<?, ?it/s]
0%| | 0/1 [00:03<?, ?it/s]
Code sample
Expected behavior
Environment
pip
, source): pipAdditional context
The error may caused by the audio, since I split the input audio into short parts, the error still accurs when processing the first audio, the following audios can proceed successfully.
I updated the input audio to DingDing Group in 2024/12/13, the file name is Into+the+Uncut+Grass+-+Trevor+Noah.mp3
The text was updated successfully, but these errors were encountered: