Spaces:
Running
on
Zero
Running
on
Zero
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) | |