|
import gradio as gr |
|
import pandas as pd |
|
|
|
def generate_solutions(query): |
|
|
|
|
|
solutions = [ |
|
{"Solution": "Check the power supply", "Link": "https://example.com/power-supply"}, |
|
{"Solution": "Inspect the wiring", "Link": "https://example.com/wiring-inspection"}, |
|
{"Solution": "Update the firmware", "Link": "https://example.com/firmware-update"} |
|
] |
|
|
|
|
|
df = pd.DataFrame(solutions) |
|
|
|
|
|
table_html = df.to_html(escape=False, index=False, render_links=True) |
|
|
|
return table_html |
|
|
|
|
|
iface = gr.Interface( |
|
fn=generate_solutions, |
|
inputs=gr.Textbox(lines=2, placeholder="Describe the problem with the machine..."), |
|
outputs=gr.HTML(), |
|
title="Oroz: Your Industry Maintenance Assistant", |
|
description="Describe the problem with your machine, and get an organized table of suggested solutions with web links." |
|
) |
|
|
|
iface.launch() |
|
|