whisper-demo-es-medium / transcriber.py
juancopi81's picture
Create YouTube Illustrated Summary
6249bc9
raw
history blame
374 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:
try:
transcription = self.pipe(file_path)["text"]
return transcription
except:
return "ERROR: No audio file found to transcribe"