spycoder commited on
Commit
742aafd
·
1 Parent(s): 928f50f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -45,7 +45,7 @@ The model was trained on Thai audio recordings with the following sentences: \n
45
 
46
  def predict(file_upload,microphone_path):
47
  max_length = 100000
48
- file_path = file_upload
49
  if (microphone is not None) and (file_upload is not None):
50
  warn_output = (
51
  "WARNING: You've uploaded an audio file and used the microphone. "
@@ -55,9 +55,9 @@ def predict(file_upload,microphone_path):
55
  elif (microphone is None) and (file_upload is None):
56
  return "ERROR: You have to either use the microphone or upload an audio file"
57
  if(microphone is not None):
58
- file_path = microphone
59
  if(file_upload is not None):
60
- file_path = file_upload
61
  model.eval()
62
  with torch.no_grad():
63
  wav_data, _ = sf.read(file_path.name)
 
45
 
46
  def predict(file_upload,microphone_path):
47
  max_length = 100000
48
+ file_path = filepath(file_upload)
49
  if (microphone is not None) and (file_upload is not None):
50
  warn_output = (
51
  "WARNING: You've uploaded an audio file and used the microphone. "
 
55
  elif (microphone is None) and (file_upload is None):
56
  return "ERROR: You have to either use the microphone or upload an audio file"
57
  if(microphone is not None):
58
+ file_path = filepath(microphone)
59
  if(file_upload is not None):
60
+ file_path = filepath(microphone)
61
  model.eval()
62
  with torch.no_grad():
63
  wav_data, _ = sf.read(file_path.name)