HistorySpace / app.py
oberbics's picture
Update app.py
f08bea0 verified
raw
history blame
963 Bytes
import gradio as gr
def extract_structure(template, text):
return "βœ… Test worked", '{"name": "John Smith", "email": "[email protected]"}', "<p>Success</p>"
with gr.Blocks() as demo:
gr.Markdown("# 🧠 NuExtract-1.5 Information Extractor")
with gr.Row():
with gr.Column():
template_input = gr.Textbox(label="Template (JSON)", lines=5)
text_input = gr.Textbox(label="Input Text", lines=10)
submit_btn = gr.Button("Extract Information")
with gr.Column():
progress_output = gr.Textbox(label="Progress")
result_output = gr.Textbox(label="Extracted Information")
html_output = gr.HTML(label="Info")
submit_btn.click(
fn=extract_structure,
inputs=[template_input, text_input],
outputs=[progress_output, result_output, html_output]
)
print("βœ… Button click event bound!")
if __name__ == "__main__":
demo.launch(ssr=False)