Instructions to use MoyAI/password-security with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use MoyAI/password-security with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://MoyAI/password-security") - Notebooks
- Google Colab
- Kaggle
Update start.py
Browse files
start.py
CHANGED
|
@@ -5,7 +5,7 @@ import numpy as np
|
|
| 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=
|
| 9 |
|
| 10 |
def clf(text: str):
|
| 11 |
return model.predict(preprocess(text))
|
|
|
|
| 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))
|