Spaces:
Running
on
Zero
Running
on
Zero
Advik
commited on
Commit
·
f776ced
1
Parent(s):
08abcbb
global vars
Browse files
app.py
CHANGED
@@ -105,6 +105,7 @@ class BiScope:
|
|
105 |
# ===========================================================
|
106 |
@spaces.GPU
|
107 |
def evaluate(diveye, biscope, text):
|
|
|
108 |
diveye_features = diveye.compute_features(text)
|
109 |
biscope_features = biscope.detect_single_sample(text)
|
110 |
|
@@ -113,7 +114,8 @@ def evaluate(diveye, biscope, text):
|
|
113 |
|
114 |
return model.predict_proba([diveye_features])[:, 1][0].item()
|
115 |
|
116 |
-
def detect_ai_text(
|
|
|
117 |
if not loaded:
|
118 |
return "❗ Model not loaded. We require a GPU to run DivEye.", 0.0, pd.DataFrame({
|
119 |
"Source": ["AI Generated", "Human Written"],
|
|
|
105 |
# ===========================================================
|
106 |
@spaces.GPU
|
107 |
def evaluate(diveye, biscope, text):
|
108 |
+
global model
|
109 |
diveye_features = diveye.compute_features(text)
|
110 |
biscope_features = biscope.detect_single_sample(text)
|
111 |
|
|
|
114 |
|
115 |
return model.predict_proba([diveye_features])[:, 1][0].item()
|
116 |
|
117 |
+
def detect_ai_text(text):
|
118 |
+
global loaded, diveye, biscope, model
|
119 |
if not loaded:
|
120 |
return "❗ Model not loaded. We require a GPU to run DivEye.", 0.0, pd.DataFrame({
|
121 |
"Source": ["AI Generated", "Human Written"],
|