spycoder commited on
Commit
2ad0a34
1 Parent(s): 15a6f16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -46,6 +46,7 @@ The model was trained on Thai audio recordings with the following sentences: \n
46
  def predict(file_upload,microphone):
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. "
@@ -75,7 +76,7 @@ def predict(file_upload,microphone):
75
  logits = logits.squeeze()
76
  predicted_class_id = torch.argmax(logits, dim=-1).item()
77
 
78
- return "You probably have SP" if predicted_class_id == 1 else "You probably don't have SP"
79
  gr.Interface(
80
  fn=predict,
81
  inputs=[
 
46
  def predict(file_upload,microphone):
47
  max_length = 100000
48
  file_path =file_upload
49
+ warn_output = " "
50
  if (microphone is not None) and (file_upload is not None):
51
  warn_output = (
52
  "WARNING: You've uploaded an audio file and used the microphone. "
 
76
  logits = logits.squeeze()
77
  predicted_class_id = torch.argmax(logits, dim=-1).item()
78
 
79
+ return warn_output + "\n" + "You probably have SP" if predicted_class_id == 1 else "You probably don't have SP"
80
  gr.Interface(
81
  fn=predict,
82
  inputs=[