Sleepyriizi commited on
Commit
65cb2f2
Β·
verified Β·
1 Parent(s): 3477806

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -12,17 +12,21 @@ import re, torch, gradio as gr
12
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
13
  from huggingface_hub import hf_hub_download
14
  import spaces
 
15
 
16
- # ── Configuration ────────────────────────────────────────────────────────
 
 
 
 
 
 
 
17
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
18
  WEIGHT_REPO = "Sleepyriizi/Orify-Text-Detection-Weights"
19
-
20
- FILE_MAP = { # local alias -> file in repo
21
- "ensamble_1" : "ensamble_1",
22
- "ensamble_2.bin": "ensamble_2.bin",
23
- "ensamble_3" : "ensamble_3"
24
- }
25
-
26
  BASE_MODEL_NAME = "answerdotai/ModernBERT-base"
27
  NUM_LABELS = 41
28
 
 
12
  from transformers import AutoTokenizer, AutoModelForSequenceClassification
13
  from huggingface_hub import hf_hub_download
14
  import spaces
15
+ import os # NEW
16
 
17
+ # ────────────────── hot-patch torch.compile ────────────────────────────
18
+ if hasattr(torch, "compile"): # NEW
19
+ def _no_compile(model, *args, **kw): # NEW
20
+ return model # NEW
21
+ torch.compile = _no_compile # NEW
22
+ os.environ["TORCHINDUCTOR_DISABLED"] = "1" # NEW
23
+
24
+ # (everything below is unchanged)
25
  DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
26
  WEIGHT_REPO = "Sleepyriizi/Orify-Text-Detection-Weights"
27
+ FILE_MAP = {"ensamble_1":"ensamble_1",
28
+ "ensamble_2.bin":"ensamble_2.bin",
29
+ "ensamble_3":"ensamble_3"}
 
 
 
 
30
  BASE_MODEL_NAME = "answerdotai/ModernBERT-base"
31
  NUM_LABELS = 41
32