Spaces:
Sleeping
Sleeping
Infinitode Pty Ltd
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ def extract_features(password):
|
|
32 |
# Function to predict password strength
|
33 |
def predict_password_strength(password):
|
34 |
if not model or not vectorizer:
|
35 |
-
return ["", "", "Model or vectorizer not loaded correctly"]
|
36 |
|
37 |
try:
|
38 |
# Extract features from the input password
|
@@ -57,9 +57,10 @@ def predict_password_strength(password):
|
|
57 |
else:
|
58 |
text = "Unknown strength level."
|
59 |
|
60 |
-
|
|
|
61 |
except Exception as e:
|
62 |
-
return [password, "", f"Error during prediction: {e}"]
|
63 |
|
64 |
# Gradio Interface
|
65 |
demo = gr.Interface(
|
|
|
32 |
# Function to predict password strength
|
33 |
def predict_password_strength(password):
|
34 |
if not model or not vectorizer:
|
35 |
+
return [["", "", "Model or vectorizer not loaded correctly"]]
|
36 |
|
37 |
try:
|
38 |
# Extract features from the input password
|
|
|
57 |
else:
|
58 |
text = "Unknown strength level."
|
59 |
|
60 |
+
# Return the result as a list of lists to match the DataFrame format
|
61 |
+
return [[password, prediction, text]]
|
62 |
except Exception as e:
|
63 |
+
return [[password, "", f"Error during prediction: {e}"]]
|
64 |
|
65 |
# Gradio Interface
|
66 |
demo = gr.Interface(
|