Spaces:
Configuration error
Configuration error
Update agent.py
Browse files86 unmodified lines878889909192939495969786 unmodified linesdef __init__(self):super().__init__()self.model = whisper.load_model("base")def forward(self, audio_path: str) -> str:if not os.path.exists(audio_path):return f"Error: File not found at {audio_path}"try:print(f"Starting transcription for {audio_path}...")result = self.model.transcribe(audio_path)86 unmodified lines8788899091929394959697989910010110210310410586 unmodified linesdef __init__(self):super().__init__()try:print("Loading whisper model 'base'...")self.model = whisper.load_model("base")print("Whisper model loaded successfully.")except Exception as e:print(f"Error loading whisper model: {e}")self.model = Nonedef forward(self, audio_path: str) -> str:if not os.path.exists(audio_path):return f"Error: File not found at {audio_path}"if self.model is None:return "Error: Whisper model failed to load during initialization."try:print(f"Starting transcription for {audio_path}...")result = self.model.transcribe(audio_path)
agent.py+9-1