Views
No views yet
| Setting | Value |
|---|---|
| Epochs | 1 |
| Batch size (train) | 16 |
| Learning rate | 2e-5 |
| Warmup steps | 500 |
| Weight decay | 0.01 |
| Dropout | 0.2 |
| Max seq length | 512 |
| Validation split | 10% |
| Best model metric | ROC-AUC |
1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2import torch
3
4model = AutoModelForSequenceClassification.from_pretrained("Moodlerz/distilbert-detector-hc3")
5tokenizer = AutoTokenizer.from_pretrained("Moodlerz/distilbert-detector-hc3")
6
7text = "Your input text here"
8inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
9with torch.no_grad():
10 logits = model(**inputs).logits
11prob_llm = torch.softmax(logits, dim=-1)[0][1].item()
12print(f"P(LLM-generated): {prob_llm:.4f}")./models/DistilBERT_hc3Moodlerz.