Spaces:
Running
Running
Revert to simple from_pretrained, ONNX files removed from model repo
Browse files
app.py
CHANGED
|
@@ -7,17 +7,11 @@ from html.parser import HTMLParser
|
|
| 7 |
import gradio as gr
|
| 8 |
from adaptive_classifier import AdaptiveClassifier
|
| 9 |
|
| 10 |
-
# Load model once at startup
|
| 11 |
-
print("Downloading model...")
|
| 12 |
-
from huggingface_hub import hf_hub_download
|
| 13 |
-
import os, tempfile
|
| 14 |
-
|
| 15 |
-
_tmp = tempfile.mkdtemp()
|
| 16 |
-
for f in ["config.json", "examples.json", "model.safetensors"]:
|
| 17 |
-
hf_hub_download("adaptive-classifier/ai-detector", f, local_dir=_tmp)
|
| 18 |
-
|
| 19 |
print("Loading model...")
|
| 20 |
-
classifier = AdaptiveClassifier.
|
|
|
|
|
|
|
| 21 |
print("Model loaded!")
|
| 22 |
|
| 23 |
HEADERS = {
|
|
|
|
| 7 |
import gradio as gr
|
| 8 |
from adaptive_classifier import AdaptiveClassifier
|
| 9 |
|
| 10 |
+
# Load model once at startup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
print("Loading model...")
|
| 12 |
+
classifier = AdaptiveClassifier.from_pretrained(
|
| 13 |
+
"adaptive-classifier/ai-detector", use_onnx=False
|
| 14 |
+
)
|
| 15 |
print("Model loaded!")
|
| 16 |
|
| 17 |
HEADERS = {
|