Oroz / app.py
zcodel's picture
Update app.py
978099a verified
raw
history blame
1.14 kB
import gradio as gr
import pandas as pd
def generate_solutions(query):
# Dummy function to simulate solution generation
# Replace with your actual logic for generating solutions
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"}
]
# Convert solutions to a DataFrame
df = pd.DataFrame(solutions)
# Convert DataFrame to HTML table with clickable links
table_html = df.to_html(escape=False, index=False, render_links=True)
return table_html
# Create a Gradio interface
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 precisely, and get an organized table of suggested solutions with web links."
)
iface.launch(share=True)