Porjaz commited on
Commit
39fbfd3
·
verified ·
1 Parent(s): 453c7eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -77,12 +77,12 @@ def return_prediction_whisper_mic(mic=None, device=device):
77
 
78
  @spaces.GPU(duration=30)
79
  def return_prediction_whisper_file(file=None, device=device):
80
- #if file in not None:
81
- waveform, sr = librosa.load(file, sr=16000)
82
- waveform = waveform[:3600*sr]
83
- whisper_result = whisper_classifier.classify_file_whisper_mkd_streaming(waveform, device)
84
- #else:
85
- # yield "You must provide a mic recording"
86
 
87
  recap_result = ""
88
  prev_segment = ""
 
77
 
78
  @spaces.GPU(duration=30)
79
  def return_prediction_whisper_file(file=None, device=device):
80
+ if file is not None:
81
+ waveform, sr = librosa.load(file, sr=16000)
82
+ waveform = waveform[:3600*sr]
83
+ whisper_result = whisper_classifier.classify_file_whisper_mkd_streaming(waveform, device)
84
+ else:
85
+ yield "You must provide a mic recording"
86
 
87
  recap_result = ""
88
  prev_segment = ""