Run this model with HF Jobs
Run MoyAI/password-security on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/MoyAI/password-security. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MoyAI/password-security on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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 net.py
Browse files12345678910111213141516171819204 unmodified lines252627282930313233343536373839404142from tensorflow.keras.preprocessing.sequence import pad_sequencesfrom tensorflow.keras.layers import Dense, Embedding, Flatten, Dropoutfrom tensorflow.keras.models import Sequentialimport numpy as npimport csvdataset = "dataset.csv"inp_len = 16X = []y = []with open(dataset, 'r') as f:csv_reader = csv.reader(f)next(csv_reader) # Skip the header row if it existsfor row in csv_reader:label = int(row[0])text = row[1]text = [ord(char) for char in text]4 unmodified linesy = np.array(y)model = Sequential()model.add(Embedding(input_dim=1500, output_dim=256, input_length=inp_len))model.add(Flatten())model.add(Dropout(0.5))model.add(Dense(512, activation="tanh"))model.add(Dropout(0.5))model.add(Dense(256, activation="selu"))model.add(Dense(256, activation="softplus"))model.add(Dense(1, activation="softplus"))model.compile(optimizer="adam", loss="binary_crossentropy", metrics=["accuracy",])model.fit(X, y, epochs=64, batch_size=4, workers=2, use_multiprocessing=True)model.save("net.h5")1234567891011121314151617181920214 unmodified lines2627282930313233343536373839404142from tensorflow.keras.preprocessing.sequence import pad_sequencesfrom tensorflow.keras.layers import Dense, Embedding, Flatten, Dropoutfrom tensorflow.keras.optimizers import Adamfrom tensorflow.keras.models import Sequentialfrom tqdm import tqdmimport numpy as npimport csvdataset = "dataset.csv"inp_len = 32X = []y = []with open(dataset, 'r') as f:csv_reader = csv.reader(f)for row in tqdm(csv_reader):if row == []: continuelabel = int(row[0])text = row[1]text = [ord(char) for char in text]4 unmodified linesy = np.array(y)model = Sequential()model.add(Embedding(input_dim=1500, output_dim=128, input_length=inp_len))model.add(Flatten())model.add(Dropout(0.2))model.add(Dense(512, activation="tanh"))model.add(Dropout(0.5))model.add(Dense(200, activation="selu"))model.add(Dense(128, activation="softplus"))model.add(Dense(1, activation="softplus"))model.compile(optimizer=Adam(learning_rate=0.00001), loss="mse", metrics=["accuracy",])model.fit(X, y, epochs=2, batch_size=4, workers=4, use_multiprocessing=True)model.save("net.h5")
net.py+11-11