codelion commited on
Commit
6521c53
·
verified ·
1 Parent(s): 3ef8ca4

Revert to simple from_pretrained, ONNX files removed from model repo

Browse files
Files changed (1) hide show
  1. app.py +4 -10
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 — download only needed files (skip 1.35GB ONNX)
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.load(_tmp, use_onnx=False)
 
 
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 = {