I´m trying to use Whisper model but occours an error saying:
UserWarning: FP16 is not supported on CPU; using FP32 instead warnings.warn("FP16 is not supported on CPU; using FP32 instead") file not found. exiting process.
my code:
import whisper
import os
# created this logic to get the real path to the file
current_dir = os.path.dirname(os.path.abspath(__file__))
file_name = "audio.wav"
file_path = os.path.join(current_dir, file_name)
print(file_path)
# the transcript logic:
listen = file_path
def transcribe():
model = whisper.load_model("large")
result = model.transcribe(listen)
print(result["text"])
return result
try:
result = transcribe()
with open("transcript.txt", "w") as file:
file.write(result["text"])
print("file saved")
except FileNotFoundError:
print("file not found.")
except PermissionError:
print("Not permitted to save file.")
except Exception as e:
print("An unknow error occured:", str(e))
finally:
print("exiting process.")
Thanks for now
By the way, I tried this:
current_dir = os.path.dirname(os.path.abspath(__file__))
file_name = "audio.wav"
file_path = os.path.join(current_dir, file_name)
print(file_path)
and the path by itself = "C:\Users\rene.pessoto\Desktop\Audio\audio.wav" and ("C:\Users\rene.pessoto\Desktop\Audio", "audio.wav") but I can´t finish it yet.
*the file has 39 minutes and its size is 214MB