Update app.py
Browse files
app.py
CHANGED
|
@@ -62,13 +62,16 @@ def predict(file_path):
|
|
| 62 |
logits = model(**inputs).logits
|
| 63 |
logits = logits.squeeze()
|
| 64 |
predicted_class_id = torch.argmax(logits, dim=-1).item()
|
| 65 |
-
|
| 66 |
-
|
|
|
|
|
|
|
|
|
|
| 67 |
gr.Interface(
|
| 68 |
fn=predict,
|
| 69 |
inputs=[
|
| 70 |
-
gr.inputs.Audio(source="microphone", type="
|
| 71 |
-
gr.inputs.Audio(source="upload", type="
|
| 72 |
],
|
| 73 |
outputs="text",
|
| 74 |
title=title,
|
|
|
|
| 62 |
logits = model(**inputs).logits
|
| 63 |
logits = logits.squeeze()
|
| 64 |
predicted_class_id = torch.argmax(logits, dim=-1).item()
|
| 65 |
+
if(predicted_class_id==0):
|
| 66 |
+
ans = "no_parkinson"
|
| 67 |
+
else:
|
| 68 |
+
ans = "parkinson"
|
| 69 |
+
return ans
|
| 70 |
gr.Interface(
|
| 71 |
fn=predict,
|
| 72 |
inputs=[
|
| 73 |
+
gr.inputs.Audio(source="microphone", type="file", optional=True),
|
| 74 |
+
gr.inputs.Audio(source="upload", type="file", optional=True),
|
| 75 |
],
|
| 76 |
outputs="text",
|
| 77 |
title=title,
|