Spaces:
Sleeping
Sleeping
Infinitode Pty Ltd
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import joblib
|
|
3 |
from sklearn.feature_extraction.text import TfidfVectorizer
|
4 |
from sklearn.calibration import CalibratedClassifierCV
|
5 |
|
6 |
-
def
|
7 |
password_tfidf = vectorizer.transform([password_input])
|
8 |
|
9 |
# Make predictions
|
@@ -25,7 +25,7 @@ model = joblib.load("helix-psa.pkl")
|
|
25 |
vectorizer = joblib.load("helix-psa-vectorizer.pkl")
|
26 |
|
27 |
demo = gr.Interface(
|
28 |
-
fn=
|
29 |
inputs=[gr.Textbox('Hello123', label='Password', info='The password to check the strength of', max_lines=1)],
|
30 |
outputs=[gr.Dataframe(row_count = (2, "dynamic"), col_count=(3, "fixed"), label="Generated Names", headers=["Password", "Prediction", "Confidence"])],
|
31 |
title='Helix - Password Strength Analyzer',
|
|
|
3 |
from sklearn.feature_extraction.text import TfidfVectorizer
|
4 |
from sklearn.calibration import CalibratedClassifierCV
|
5 |
|
6 |
+
def predictPasswordStrength(model, vectorizer, password_input):
|
7 |
password_tfidf = vectorizer.transform([password_input])
|
8 |
|
9 |
# Make predictions
|
|
|
25 |
vectorizer = joblib.load("helix-psa-vectorizer.pkl")
|
26 |
|
27 |
demo = gr.Interface(
|
28 |
+
fn=predictPasswordStrength,
|
29 |
inputs=[gr.Textbox('Hello123', label='Password', info='The password to check the strength of', max_lines=1)],
|
30 |
outputs=[gr.Dataframe(row_count = (2, "dynamic"), col_count=(3, "fixed"), label="Generated Names", headers=["Password", "Prediction", "Confidence"])],
|
31 |
title='Helix - Password Strength Analyzer',
|