add playgrounds

This commit is contained in:
Cristiano Ferreira
2023-05-08 09:27:24 +01:00
parent 838411cbdd
commit d1bac041c7
12 changed files with 543 additions and 0 deletions

12
testing.py Normal file
View File

@@ -0,0 +1,12 @@
import whisper
import os
from pydub import AudioSegment
model = whisper.load_model("base")
file_path = "audio-samples/mynameisjeff.wav"
audio_file = AudioSegment.from_file(file_path)
if os.path.exists(file_path):
result = model.transcribe(file_path, fp16=False, language='English', verbose=True)
print(result["text"])
else:
print("File not found:", file_path)