我有一个问题,所以我希望一些程序员能帮我解决这个问题。
--基本上我运行的是:
import whisper
model = whisper.load_model("base")
result = model.transcribe('test.mp3', fp16=False)
和我明白了:
Output exceeds the size limit. Open the full output data in a text editor.
Error Traceback (most recent call last)
File
38 try:
39 # This launches a subprocess to decode audio while down-mixing and resampling as necessary.
40 # Requires the ffmpeg CLI and `ffmpeg-python` package to be installed.
41 out, _ = (
---> 42 ffmpeg.input(file, threads=0)
43 .output("-", format="s16le", acodec="pcm_s16le", ac=1, ar=sr)
44 .run(cmd=["ffmpeg", "-nostdin"], capture_stdout=True, capture_stderr=True)
45 )
46 except ffmpeg.Error as e:
File
324 if retcode:
--> 325 raise Error('ffmpeg', out, err)
326 return out, err `
Error: ffmpeg error (see stderr output for detail)
The above exception was the direct cause of the following exception:
RuntimeError Traceback (most recent call last)
Cell In[25], line 4
1 import whisper
...
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
test.mp3: No such file or directory
我的目标只是将mp3音频文件"test.mp3“转录成文本,通过OpenAI的AI语音。
我只是想让一些音频文件工作语,但这些错误阻止我这样做。
老实说,我已经做了两天了,我什么也没做,我打开了相关的文件,位于42和325行,但我不知道下一步该做什么。
提前感谢您的帮助和解释。
发布于 2022-12-04 20:59:08
使用os模块。
import os
# get the current working dir
cwd = os.getcwd()
# construct the full path to the file
file_path = os.path.join(cwd, 'test.mp3')
# transcribe the file
result = model.transcribe(file_path, fp16=False)
https://stackoverflow.com/questions/74680851
复制相似问题