Andrei-Iulian SĂCELEANU commited on
Commit
674a3ea
1 Parent(s): c9f00c5
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -37,12 +37,13 @@ def ssl_predict(in_text, model_type):
37
  model = FixMatchTune(encoder_name="andrei-saceleanu/ro-offense-freematch")
38
  model.cls_head.load_weights("./checkpoints/freematch_tune")
39
 
40
- print(toks["input_ids"])
41
  preds, _ = model([toks["input_ids"],toks["attention_mask"]], training=False)
42
- print(preds)
43
  probs = list(preds[0].numpy())
44
 
45
- return {k:v for k, v in zip(label_names, probs)}
 
 
 
46
 
47
 
48
 
 
37
  model = FixMatchTune(encoder_name="andrei-saceleanu/ro-offense-freematch")
38
  model.cls_head.load_weights("./checkpoints/freematch_tune")
39
 
 
40
  preds, _ = model([toks["input_ids"],toks["attention_mask"]], training=False)
 
41
  probs = list(preds[0].numpy())
42
 
43
+ d = {}
44
+ for k, v in zip(label_names, probs):
45
+ d[k] = float(v)
46
+ return d
47
 
48
 
49