Я получаю эту ошибку: FileNotFoundError: [WinError 2] , я не знаю, может быть, я просто глуп, но я знаю, что файл существует с использованием определенного пути к файлу и работает, спасибо за ваше время и помощь. Код:import whisper
# Load the Whisper model
model_size = "medium"
model = whisper.load_model(model_size)
# Specify the file path
file_path = "temp_audio.mp3"
# Verify the file path by printing it
print(f"Transcribing file: {file_path}")
# Transcribe the audio file
result = model.transcribe("temp_audio.mp3")
# Print the segments and word-level information
for segment in result["segments"]:
print(f"[{segment['start']:.2f}s -> {segment['end']:.2f}s] {segment['text']}")
# Since word-level timestamps are not directly available,
# we will just collect the text for now.
wordlevel_info = []
for segment in result["segments"]:
words = segment['text'].split()
start = segment['start']
end = segment['end']
duration = (end - start) / len(words) if words else 0
for i, word in enumerate(words):
word_start = start + i * duration
word_end = word_start + duration
wordlevel_info.append({'word': word, 'start': word_start, 'end': word_end})
# Display the collected word-level information
wordlevel_info
Подробнее здесь: https://stackoverflow.com/questions/786 ... t-location
FileNotFoundError: [WinError 2], но файл находится в правильном месте ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Невозможно создать папки — FileNotFoundError: [WinError 2] Система не может найти файл
Anonymous » » в форуме Python - 0 Ответы
- 71 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Mpl FileNotFoundError: [WinError 2] Система не может найти указанный файл
Anonymous » » в форуме Python - 0 Ответы
- 29 Просмотры
-
Последнее сообщение Anonymous
-
-
-
Mpl FileNotFoundError: [WinError 2] Система не может найти указанный файл
Anonymous » » в форуме Python - 0 Ответы
- 17 Просмотры
-
Последнее сообщение Anonymous
-