Code-Checker / app.py
Ismael1-2-3's picture
Update app.py
8aacc0a verified
raw
history blame
803 Bytes
import gradio as gr
from transformers import T5ForConditionalGeneration, T5Tokenizer
model = T5ForConditionalGeneration.from_pretrained("t5-base")
tokenizer = T5Tokenizer.from_pretrained("t5-base")
def evaluate_password_strength(password):
input_text = f"Rate the strength of the password: {password}"
inputs = tokenizer(input_text, return_tensors="pt")
output = model.generate(**inputs)
response = tokenizer.decode(output[0], skip_special_tokens=True)
return response
demo = gr.Interface(
evaluate_password_strength,
gr.Textbox(label="Enter your password"),
gr.Textbox(label="Password Strength Evaluation"),
title="Password Strength Evaluator",
description="Get the AI's evaluation of your password strength.",
)
if __name__ == "__main__":
demo.launch()