Manul, da
commited on
Commit
·
3341e01
1
Parent(s):
190032c
Create start.py
Browse files
start.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from tensorflow.keras.models import load_model
|
| 2 |
+
from tensorflow.keras.preprocessing.sequence import pad_sequences
|
| 3 |
+
import numpy as np
|
| 4 |
+
|
| 5 |
+
model = load_model("net.h5")
|
| 6 |
+
|
| 7 |
+
def preprocess(text: str):
|
| 8 |
+
return np.array(pad_sequences([[ord(char) for char in text],], maxlen=32, padding='post'))
|
| 9 |
+
|
| 10 |
+
def clf(text: str):
|
| 11 |
+
return model.predict(preprocess(text))
|
| 12 |
+
|
| 13 |
+
if __name__ == "__main__":
|
| 14 |
+
while True:
|
| 15 |
+
print("Secure:", clf(input("Password: "))[0])
|