jcmachicao commited on
Commit
8de164f
verified
1 Parent(s): 48906c8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -8
app.py CHANGED
@@ -54,12 +54,23 @@ def generacion_llm(texto_input):
54
  return f"Error: {e}"
55
 
56
  # Define Gradio app
57
- interface = gr.Interface(
58
- fn=generacion_llm,
59
- inputs=gr.Textbox(label="Ingrese su texto libre para estructurar."),
60
- outputs=gr.Textbox(label="Resultado JSON"),
61
- title="Estructurador de Autodiagn贸stico",
62
- description="Ingrese el texto para analizar y extraer informaci贸n en un formato JSON predefinido."
 
 
 
 
 
 
 
 
 
 
 
63
  gr.Markdown(
64
  """
65
  <br>
@@ -68,6 +79,6 @@ interface = gr.Interface(
68
  </div>
69
  """
70
  )
71
- )
72
 
73
- interface.launch(share=True)
 
 
54
  return f"Error: {e}"
55
 
56
  # Define Gradio app
57
+ with gr.Blocks() as interface:
58
+ # Title and description
59
+ gr.Markdown(
60
+ """
61
+ # Estructurador de Autodiagn贸stico
62
+ Ingrese el texto para analizar y extraer informaci贸n en un formato JSON predefinido.
63
+ """
64
+ )
65
+ # Input and output components
66
+ input_text = gr.Textbox(label="Ingrese su texto libre para estructurar.")
67
+ output_json = gr.Textbox(label="Resultado JSON")
68
+ submit_button = gr.Button("Procesar")
69
+
70
+ # Link the input/output and function
71
+ submit_button.click(fn=generacion_llm, inputs=input_text, outputs=output_json)
72
+
73
+ # Add the logo at the end
74
  gr.Markdown(
75
  """
76
  <br>
 
79
  </div>
80
  """
81
  )
 
82
 
83
+ # Launch the interface
84
+ interface.launch(share=True)