首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >打开AI耳语:这些错误让我很生气(请帮帮忙)

打开AI耳语:这些错误让我很生气(请帮帮忙)
EN

Stack Overflow用户
提问于 2022-12-04 20:55:55
回答 1查看 24关注 0票数 -3

我有一个问题,所以我希望一些程序员能帮我解决这个问题。

--基本上我运行的是:

代码语言:javascript
运行
复制
import whisper
 
model = whisper.load_model("base")
result = model.transcribe('test.mp3', fp16=False)

和我明白了:

代码语言:javascript
运行
复制
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行,但我不知道下一步该做什么。

提前感谢您的帮助和解释。

EN

回答 1

Stack Overflow用户

发布于 2022-12-04 20:59:08

使用os模块。

代码语言:javascript
运行
复制
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)
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74680851

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档