Spaces:
Running
on
Zero
Running
on
Zero
File size: 963 Bytes
be196c4 095dbb9 f08bea0 26a1605 f764538 26a1605 f764538 f08bea0 f764538 26a1605 f764538 26a1605 f764538 f08bea0 23c0ee1 f08bea0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
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)
|