Update app.py
Browse files
app.py
CHANGED
@@ -55,10 +55,10 @@ def predict(file_upload,microphone):
|
|
55 |
|
56 |
elif (microphone is None) and (file_upload is None):
|
57 |
return "ERROR: You have to either use the microphone or upload an audio file"
|
58 |
-
if(microphone is not None):
|
59 |
-
file_path = microphone
|
60 |
if(file_upload is not None):
|
61 |
file_path = file_upload
|
|
|
|
|
62 |
model.eval()
|
63 |
with torch.no_grad():
|
64 |
wav_data, _ = sf.read(file_path)
|
@@ -76,7 +76,7 @@ def predict(file_upload,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=[
|
|
|
55 |
|
56 |
elif (microphone is None) and (file_upload is None):
|
57 |
return "ERROR: You have to either use the microphone or upload an audio file"
|
|
|
|
|
58 |
if(file_upload is not None):
|
59 |
file_path = file_upload
|
60 |
+
if(microphone is not None):
|
61 |
+
file_path = microphone
|
62 |
model.eval()
|
63 |
with torch.no_grad():
|
64 |
wav_data, _ = sf.read(file_path)
|
|
|
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 warn_output + "\n" + "You probably don't have SP"
|
80 |
gr.Interface(
|
81 |
fn=predict,
|
82 |
inputs=[
|