ancerlop commited on
Commit
605db98
1 Parent(s): 5bd70fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -24,9 +24,9 @@ def procesar_entrada(texto_entrada, rag_habilitado, prompt_template_habilitado):
24
  return [respuesta] + [False] * len(mostrar_checkboxes(datos_json))
25
 
26
  # Funci贸n para guardar los checkbox marcados en un archivo JSON
27
- def guardar_checkbox_info(checkboxes, ruta_json):
28
- info_checkbox = {key: value for key, value in checkboxes.items()}
29
- with open(ruta_json, 'w') as file:
30
  json.dump(info_checkbox, file, indent=4)
31
 
32
  # Ruta al archivo JSON
@@ -45,7 +45,7 @@ interfaz = gr.Interface(
45
  outputs=[
46
  gr.Textbox(label="Texto de Salida", type="text"),
47
  *checkboxes_tipos.values(),
48
- gr.Button(label="Guardar en JSON", type="button", live=True)
49
  ]
50
  )
51
 
 
24
  return [respuesta] + [False] * len(mostrar_checkboxes(datos_json))
25
 
26
  # Funci贸n para guardar los checkbox marcados en un archivo JSON
27
+ def guardar_checkbox_info():
28
+ info_checkbox = {key: checkbox.value for key, checkbox in checkboxes_tipos.items()}
29
+ with open('rlhf.json', 'w') as file:
30
  json.dump(info_checkbox, file, indent=4)
31
 
32
  # Ruta al archivo JSON
 
45
  outputs=[
46
  gr.Textbox(label="Texto de Salida", type="text"),
47
  *checkboxes_tipos.values(),
48
+ gr.Button(text="Guardar en JSON", type="button", live=False, callback=guardar_checkbox_info)
49
  ]
50
  )
51