SebastianItamari commited on
Commit
deffcdb
·
verified ·
1 Parent(s): 12e6671

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
app.py CHANGED
@@ -20,8 +20,16 @@ if st.button("Generar texto"):
20
  if user_input:
21
  # Generar el texto utilizando el modelo
22
  with st.spinner("Generando..."):
23
- result = generator(user_input, do_sample=True, min_length=50, max_length=100)
 
 
 
 
 
 
 
24
  generated_text = result[0]['generated_text']
 
25
  # Mostrar el texto generado
26
  st.subheader("Texto generado:")
27
  st.write(generated_text)
 
20
  if user_input:
21
  # Generar el texto utilizando el modelo
22
  with st.spinner("Generando..."):
23
+ result = generator(
24
+ user_input,
25
+ do_sample=True,
26
+ min_length=50,
27
+ max_length=100,
28
+ clean_up_tokenization_spaces=True, # Limpieza de espacios activada explícitamente
29
+ truncation=True # Activar truncamiento para evitar advertencias
30
+ )
31
  generated_text = result[0]['generated_text']
32
+
33
  # Mostrar el texto generado
34
  st.subheader("Texto generado:")
35
  st.write(generated_text)