Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
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 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
18 |
WEIGHT_REPO = "Sleepyriizi/Orify-Text-Detection-Weights"
|
19 |
-
|
20 |
-
|
21 |
-
|
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 |
|