tebicap commited on
Commit
a7be45a
·
1 Parent(s): 27f023c

truncado sino no anda, y live cambiado a False

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -9,7 +9,7 @@ tokenizer = T5Tokenizer.from_pretrained(model_name)
9
  # Define a function to generate text using T5
10
  def generate_text(prompt):
11
  # Tokenize input and generate output
12
- input_ids = tokenizer.encode(prompt, return_tensors="pt", max_length=512, truncation=False)
13
  output_ids = model.generate(input_ids)
14
 
15
  # Decode the generated output
@@ -22,7 +22,7 @@ iface = gr.Interface(
22
  fn=generate_text,
23
  inputs=gr.Textbox(),
24
  outputs=gr.Textbox(),
25
- live=True,
26
  title="T5 Text Generation",
27
  description="Enter a prompt, and the model will generate text based on it."
28
  )
 
9
  # Define a function to generate text using T5
10
  def generate_text(prompt):
11
  # Tokenize input and generate output
12
+ input_ids = tokenizer.encode(prompt, return_tensors="pt", max_length=512, truncation=True)
13
  output_ids = model.generate(input_ids)
14
 
15
  # Decode the generated output
 
22
  fn=generate_text,
23
  inputs=gr.Textbox(),
24
  outputs=gr.Textbox(),
25
+ live=False,
26
  title="T5 Text Generation",
27
  description="Enter a prompt, and the model will generate text based on it."
28
  )