|
Download gpu/README.md from matthewagi/AI-Detector-35BA3B: direct link, hf CLI and curl.
- Browser
- Download file 1.99 kB
-
https://huggingface.co/matthewagi/AI-Detector-35BA3B/resolve/main/gpu/README.md
- Command line
-
hf download hf://matthewagi/AI-Detector-35BA3B/gpu/README.md
-
curl -L -o README.md https://huggingface.co/matthewagi/AI-Detector-35BA3B/resolve/main/gpu/README.md
1.99 kB
| # AI Detector 35BA3B (Nippers) GPU inference | |
| This offline runner uses a vLLM pooling worker with the released all-token pooler, 512-token encoder lookback and three-class token head. The A100 80 GB profile uses BF16, 49,152 batch positions and the archived MoE tiles. The H100 profile uses 65,536 positions, block-FP8 experts, mixed-FP8 projections and the Hopper recurrent kernels. The reported H100 timings come from the first-epoch checkpoint. The epoch-2 A100 timings are in the model card. | |
| Use a Linux x86-64 NVIDIA host with Python 3.12, CUDA 12.9 and a compatible driver. Run from a downloaded model snapshot in a fresh virtual environment. | |
| ```sh | |
| python -m pip install -r gpu/requirements.txt | |
| python -m pip install --no-deps ./gpu | |
| python gpu/export.py ./detector-bf16 | |
| python gpu/run.py documents.jsonl scores.npz --merged ./detector-bf16 --copies 2 | |
| ``` | |
| The one-time export downloads the exact Qwen base revision in `model-config.json`, merges the released adapters and writes a serving checkpoint. Allow disk space for the base download and the merged model. For H100, use `python gpu/export.py ./detector-fp8 --fp8` and pass `--merged ./detector-fp8` to the runner. The exporter uses CUDA and the runner selects its profile from the exported checkpoint. | |
| ## Inputs and outputs | |
| Supply one nonempty JSON object per line with a `text` string. Repeat2 duplicates each document inside its own sequence and returns only the second copy. Use `--copies 1` for single-copy scoring. Documents are sorted by length for batching and restored to input order in the output. An input that exceeds the batch budget raises an error. | |
| ```python | |
| import numpy as np | |
| with np.load("scores.npz") as scores: | |
| start, end = scores["offsets"][:2] | |
| token_ids = scores["input_ids"][start:end] | |
| logits = scores["logits"][start:end] | |
| labels = np.array(["Human", "Assisted", "Generated"])[logits.argmax(axis=1)] | |
| ``` | |
| The output contains raw per-token logits before smoothing or document thresholds. | |