Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI vs Human Text Detector — ModernBERT-large + LoRA

src/detector/
  data.py      load_data, tokenize_df
  model.py     build_model (LoRA), FocalLossTrainer, compute_metrics, ci95
train.py       CONFIG + training loop (imports detector)
app.py         Gradio demo UI
pyproject.toml makes `src/` importable via `pip install -e .`

Setup

pip install -e .
pip install -r requirements.txt

Run

python train.py --smoke-test      # sanity check, seconds
python train.py                   # full run: ModernBERT-large + LoRA, 3 seeds
cp -r output/best_model_seed42 saved_model
python app.py                     # Gradio UI, localhost:7860

VS Code + Colab GPU

Edit locally in VS Code. Push to GitHub. Open colab_launcher.ipynb in Colab (Runtime → GPU), update the clone URL, run all cells — trains on free T4.

Settings

LoRA r=64/α=128 (all-linear), focal loss γ=2.0, lr=1e-4, fp16 + gradient checkpointing, early stopping (patience=5), 3-seed 95% CI.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages