eljanmahammadli commited on
Commit
6f614b5
1 Parent(s): f22250e

Update predictors.py

Browse files
Files changed (1) hide show
  1. predictors.py +9 -0
predictors.py CHANGED
@@ -153,6 +153,15 @@ def predict_quillbot(text):
153
  return q_score
154
 
155
 
 
 
 
 
 
 
 
 
 
156
  def predict_bc(model, tokenizer, text):
157
  with torch.no_grad():
158
  model.eval()
 
153
  return q_score
154
 
155
 
156
+ def predict_proba_quillbot(text):
157
+ with torch.no_grad():
158
+ tokenized_text = quillbot_tokenizer(texts, return_tensors="pt", padding=True).to(device)
159
+ outputs = quillbot_model(**tokenized_text)
160
+ tensor_logits = outputs[0]
161
+ probas = F.softmax(tensor_logits).detach().cpu().numpy()
162
+ return probas
163
+
164
+
165
  def predict_bc(model, tokenizer, text):
166
  with torch.no_grad():
167
  model.eval()