whisper-demo-es-medium / transcriber.py
juancopi81's picture
Change transcriber
6472070
raw
history blame
No virus
351 Bytes
from transformers import pipeline
class Transcriber:
def __init__(self, pipe: pipeline) -> None:
self.pipe = pipe
def transcribe(self, file_path: str = "yt_audio.mp3") -> str:
print("Pipe:", self.pipe)
print("Audo file at:", file_path)
transcription = self.pipe(file_path)["text"]
return transcription