Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,7 +27,6 @@ except ImportError:
|
|
| 27 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 28 |
|
| 29 |
# Assumes your Web files and Models are structured relative to app.py
|
| 30 |
-
# If templates are in a folder called 'templates' or 'Web', configure it here:
|
| 31 |
TEMPLATE_DIR = os.path.join(BASE_DIR, 'Web') if os.path.exists(os.path.join(BASE_DIR, 'Web')) else os.path.join(BASE_DIR, 'templates')
|
| 32 |
MODEL_PATH = os.path.join(BASE_DIR, 'Web', 'Models') if os.path.exists(os.path.join(BASE_DIR, 'Web', 'Models')) else os.path.join(BASE_DIR, 'Models')
|
| 33 |
|
|
@@ -88,7 +87,8 @@ def load_model_file(filename):
|
|
| 88 |
return None
|
| 89 |
|
| 90 |
# --- MODELS LOADING ---
|
| 91 |
-
|
|
|
|
| 92 |
markov_model = password_model
|
| 93 |
phishing_svm_model = load_model_file("phishing_svm_model.pkl")
|
| 94 |
|
|
@@ -156,7 +156,7 @@ def extract_real_features(url):
|
|
| 156 |
except:
|
| 157 |
return None # Domain invalid or down
|
| 158 |
|
| 159 |
-
# Safe WHOIS check
|
| 160 |
age_days = 0
|
| 161 |
if whois:
|
| 162 |
try:
|
|
|
|
| 27 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 28 |
|
| 29 |
# Assumes your Web files and Models are structured relative to app.py
|
|
|
|
| 30 |
TEMPLATE_DIR = os.path.join(BASE_DIR, 'Web') if os.path.exists(os.path.join(BASE_DIR, 'Web')) else os.path.join(BASE_DIR, 'templates')
|
| 31 |
MODEL_PATH = os.path.join(BASE_DIR, 'Web', 'Models') if os.path.exists(os.path.join(BASE_DIR, 'Web', 'Models')) else os.path.join(BASE_DIR, 'Models')
|
| 32 |
|
|
|
|
| 87 |
return None
|
| 88 |
|
| 89 |
# --- MODELS LOADING ---
|
| 90 |
+
# 🔗 FIXED: Pointed to the clean .joblib file to bypass Hugging Face security blocking
|
| 91 |
+
password_model = load_model_file("markov_password_model.joblib")
|
| 92 |
markov_model = password_model
|
| 93 |
phishing_svm_model = load_model_file("phishing_svm_model.pkl")
|
| 94 |
|
|
|
|
| 156 |
except:
|
| 157 |
return None # Domain invalid or down
|
| 158 |
|
| 159 |
+
# Safe WHOIS check
|
| 160 |
age_days = 0
|
| 161 |
if whois:
|
| 162 |
try:
|