Text Classification
Transformers
Safetensors
English
deberta-v2
ai-generated-text-detection
4-bit precision
bitsandbytes
nf4
quantization
text-embeddings-inference
Instructions to use batmac/gradient-ai-text-detector-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use batmac/gradient-ai-text-detector-4bit with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="batmac/gradient-ai-text-detector-4bit")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("batmac/gradient-ai-text-detector-4bit") model = AutoModelForSequenceClassification.from_pretrained("batmac/gradient-ai-text-detector-4bit", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Fix repository id in usage example
Browse files
README.md
CHANGED
|
@@ -16,7 +16,7 @@ tags:
|
|
| 16 |
- quantization
|
| 17 |
---
|
| 18 |
|
| 19 |
-
# Gradient AI Text Detector
|
| 20 |
|
| 21 |
A 4-bit NF4 quantization of
|
| 22 |
[`ShantanuT01/gradient-ai-text-detector`](https://huggingface.co/ShantanuT01/gradient-ai-text-detector),
|
|
@@ -48,7 +48,7 @@ Embeddings, LayerNorm, and the sigmoid head remain in full precision.
|
|
| 48 |
import torch
|
| 49 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 50 |
|
| 51 |
-
repo = "
|
| 52 |
tokenizer = AutoTokenizer.from_pretrained(repo)
|
| 53 |
model = AutoModelForSequenceClassification.from_pretrained(repo)
|
| 54 |
model.eval()
|
|
|
|
| 16 |
- quantization
|
| 17 |
---
|
| 18 |
|
| 19 |
+
# Gradient AI Text Detector, 4-bit NF4 (bitsandbytes)
|
| 20 |
|
| 21 |
A 4-bit NF4 quantization of
|
| 22 |
[`ShantanuT01/gradient-ai-text-detector`](https://huggingface.co/ShantanuT01/gradient-ai-text-detector),
|
|
|
|
| 48 |
import torch
|
| 49 |
from transformers import AutoModelForSequenceClassification, AutoTokenizer
|
| 50 |
|
| 51 |
+
repo = "batmac/gradient-ai-text-detector-4bit"
|
| 52 |
tokenizer = AutoTokenizer.from_pretrained(repo)
|
| 53 |
model = AutoModelForSequenceClassification.from_pretrained(repo)
|
| 54 |
model.eval()
|