Spaces:
Running
Running
Arnab Das
commited on
Commit
·
384f8dc
1
Parent(s):
5fde11f
additional changes
Browse files- app.py +8 -3
- xlsr2_300m.pt +0 -3
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import torch
|
2 |
import gradio as gr
|
3 |
import models as MOD
|
@@ -36,9 +37,13 @@ def process(file, type):
|
|
36 |
loaded_model = type
|
37 |
|
38 |
op = model(inp).detach().squeeze()[1].item()
|
39 |
-
|
40 |
-
|
41 |
-
|
|
|
|
|
|
|
|
|
42 |
return response_text
|
43 |
|
44 |
|
|
|
1 |
+
import json
|
2 |
import torch
|
3 |
import gradio as gr
|
4 |
import models as MOD
|
|
|
37 |
loaded_model = type
|
38 |
|
39 |
op = model(inp).detach().squeeze()[1].item()
|
40 |
+
output_json = {}
|
41 |
+
output_json["decision_score"] = str(op)
|
42 |
+
output_json["model_threshold"] = str(model_master[type]["eer_threshold"])
|
43 |
+
output_json["optional_note"] = "1. Any score below threshold is indicative of fake. \n2. {}".format(model_master[type]["note"])
|
44 |
+
response_text = json.dumps(output_json, indent=4)
|
45 |
+
"""response_text = "Decision score: {} \nDecision threshold: {} \nNotes: 1. Any score below threshold is indicative of fake. \n2. {} ".format(
|
46 |
+
str(op), str(model_master[type]["eer_threshold"]), model_master[type]["note"])"""
|
47 |
return response_text
|
48 |
|
49 |
|
xlsr2_300m.pt
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:b08927597f2c9eb2ebd7dcc3ac78ee4b5f6021cbac4b3a6c5a9deec445d80ed9
|
3 |
-
size 3808868242
|
|
|
|
|
|
|
|