Ismael1-2-3 commited on
Commit
8aacc0a
·
verified ·
1 Parent(s): 9caacc2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -1,18 +1,14 @@
1
  import gradio as gr
2
- from transformers import LlamaForConditionalGeneration, LlamaTokenizer
3
 
4
- # Load pre-trained model and tokenizer
5
- model_name = "meta-ai/llama-3.2-3b-instruct"
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(