ZarahShibli commited on
Commit
df8637c
1 Parent(s): cb2d33e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ import torch
9
  model_names = ['python']
10
 
11
  models = {}
12
- model = AutoModel.from_pretrained(f'ZarahShibli/tmp_trainer',return_tensors="pt")
13
 
14
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
15
  MAX_LEN = 200
@@ -45,7 +45,7 @@ def predict(comment_sentence):
45
  with torch.no_grad():
46
  outputs = model(ids, mask, token_type_ids)
47
 
48
- fin_outputs.extend(torch.sigmoid(outputs).cpu().detach().numpy().tolist())
49
  print(fin_outputs)
50
  # Convert the outputs to boolean values based on the threshold
51
  outputs_boolean = np.array(fin_outputs) >= 0.25
 
9
  model_names = ['python']
10
 
11
  models = {}
12
+ model = AutoModel.from_pretrained(f'ZarahShibli/tmp_trainer',return_dict=False)
13
 
14
  device = 'cuda' if torch.cuda.is_available() else 'cpu'
15
  MAX_LEN = 200
 
45
  with torch.no_grad():
46
  outputs = model(ids, mask, token_type_ids)
47
 
48
+ fin_outputs.extend(torch.sigmoid(torch.tensor(outputs.logits)).cpu().detach().numpy().tolist())
49
  print(fin_outputs)
50
  # Convert the outputs to boolean values based on the threshold
51
  outputs_boolean = np.array(fin_outputs) >= 0.25