Porjaz commited on
Commit
1258887
·
verified ·
1 Parent(s): 2dc0fa6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -39,7 +39,11 @@ def return_prediction_w2v2_mic(mic=None, progress=gr.Progress(), device=device):
39
  waveform = waveform[:60*sr]
40
  w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
41
  else:
42
- yield "You must either provide a mic recording or a file"
 
 
 
 
43
 
44
  recap_result = ""
45
  prev_segment = ""
@@ -79,7 +83,11 @@ def return_prediction_w2v2_file(file=None, progress=gr.Progress(), device=device
79
  w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
80
  waveform = waveform[:60*sr]
81
  else:
82
- yield "You must either provide a mic recording or a file"
 
 
 
 
83
 
84
  recap_result = ""
85
  prev_segment = ""
 
39
  waveform = waveform[:60*sr]
40
  w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
41
  else:
42
+ recap_result = " "
43
+ download_path = "empty.txt"
44
+ with open(download_path, "w") as f:
45
+ f.write(recap_result)
46
+ yield recap_result, download_path
47
 
48
  recap_result = ""
49
  prev_segment = ""
 
83
  w2v2_result = w2v2_classifier.classify_file_w2v2(waveform, device)
84
  waveform = waveform[:60*sr]
85
  else:
86
+ recap_result = " "
87
+ download_path = "empty.txt"
88
+ with open(download_path, "w") as f:
89
+ f.write(recap_result)
90
+ yield recap_result, download_path
91
 
92
  recap_result = ""
93
  prev_segment = ""