Arnab Das commited on
Commit
0b71a97
·
1 Parent(s): 3f51843
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -23,17 +23,15 @@ loaded_model = "SSL-AASIST (Trained on ASV-Spoof5)"
23
  def process(file, type):
24
  global model
25
  global loaded_model
26
- data = getattr(PD, model_master[type]["data_process_func"])(file)
27
- return type(data)
28
- """if not loaded_model == type:
29
  model = getattr(MOD, model_master[type]["model_class"])(None, "cpu")
30
  model.load_state_dict(torch.load(model_master[type]["model_checkpoint"], map_location="cpu"))
31
  loaded_model = type
32
 
33
- op = model(data).detach().squeeze()
34
- print(op)
35
-
36
- return str(file)+str(type)+str(model_master[type]["eer_threshold"]) + str(op)"""
37
 
38
  demo = gr.Blocks()
39
  file_proc = gr.Interface(
 
23
  def process(file, type):
24
  global model
25
  global loaded_model
26
+ inp = getattr(PD, model_master[type]["data_process_func"])(file)
27
+ if not loaded_model == type:
 
28
  model = getattr(MOD, model_master[type]["model_class"])(None, "cpu")
29
  model.load_state_dict(torch.load(model_master[type]["model_checkpoint"], map_location="cpu"))
30
  loaded_model = type
31
 
32
+ op = model(inp).detach().squeeze().data()
33
+ print("processed")
34
+ return str(file)+str(type)+str(model_master[type]["eer_threshold"]) + str(op)
 
35
 
36
  demo = gr.Blocks()
37
  file_proc = gr.Interface(