Skip to content

Commit 2957572

Browse files
authored
Update classifier_model.py
1 parent 1617a2e commit 2957572

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

app/classifier_model.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,11 @@ def classify_text(text, model_ai_hum, model_llm, tokenizer):
9797
else:
9898
predicted_label = "AI"
9999

100-
# with torch.no_grad():
101-
# outputs_llm = model_llm(input_ids, attention_mask=attention_mask)
102-
# logits_llm = outputs_llm.logits
103-
# predicted_llm_pred = np.argmax(logits_llm.cpu().numpy(), axis=1).item()
100+
with torch.no_grad():
101+
outputs_llm = model_llm(input_ids, attention_mask=attention_mask)
102+
logits_llm = outputs_llm.logits
103+
predicted_llm_pred = np.argmax(logits_llm.cpu().numpy(), axis=1).item()
104104

105-
106-
predicted_llm_pred = 0
107105
if predicted_llm_pred == 0:
108106
predicted_label_llm = "LLAMA"
109107
else:

0 commit comments

Comments
 (0)