Whisper(openai-whisper)导入whisper不知道whisper是什么?

问题描述 投票:0回答:1

好吧,我在做东西,我需要使用耳语,但它不知道耳语是什么我应该做什么?我还问了 chatgpt,但 chatgpt 不太聪明,所以请有人帮忙解决这个问题!

我正在阅读代码,导入耳语不起作用,这是我使用的代码

import whisper


model = whisper.load_model("base")

# load audio and pad/trim it to fit 30 seconds
audio = whisper.load_audio("audio.mp3")
audio = whisper.pad_or_trim(audio)

# make log-Mel spectrogram and move to the same device as the model
mel = whisper.log_mel_spectrogram(audio).to(model.device)

# detect the spoken language
_, probs = model.detect_language(mel)
print(f"Detected language: {max(probs, key=probs.get)}")

# decode the audio
options = whisper.DecodingOptions()
result = whisper.decode(model, mel, options)

# print the recognized text
print(result.text)
python openai-whisper
1个回答
0
投票

我认为你应该在终端中输入“pip install Whisper”。 Whisper 没有直接安装在您的 IDE 中,因此您需要自己安装。我希望这就足够了:)

© www.soinside.com 2019 - 2024. All rights reserved.