Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files
net.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f0ed955eb042a775124702c349357945d32173840a44c8c4be247e3a5e5abab7
|
3 |
+
size 29068384
|
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])
|