Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,14 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
model = LlamaForConditionalGeneration.from_pretrained(model_name)
|
7 |
-
tokenizer = LlamaTokenizer.from_pretrained(model_name)
|
8 |
|
9 |
def evaluate_password_strength(password):
|
10 |
-
# Use the Llama model to evaluate the password strength
|
11 |
input_text = f"Rate the strength of the password: {password}"
|
12 |
inputs = tokenizer(input_text, return_tensors="pt")
|
13 |
output = model.generate(**inputs)
|
14 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
15 |
-
|
16 |
return response
|
17 |
|
18 |
demo = gr.Interface(
|
|
|
1 |
import gradio as gr
|
2 |
+
from transformers import T5ForConditionalGeneration, T5Tokenizer
|
3 |
|
4 |
+
model = T5ForConditionalGeneration.from_pretrained("t5-base")
|
5 |
+
tokenizer = T5Tokenizer.from_pretrained("t5-base")
|
|
|
|
|
6 |
|
7 |
def evaluate_password_strength(password):
|
|
|
8 |
input_text = f"Rate the strength of the password: {password}"
|
9 |
inputs = tokenizer(input_text, return_tensors="pt")
|
10 |
output = model.generate(**inputs)
|
11 |
response = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
12 |
return response
|
13 |
|
14 |
demo = gr.Interface(
|