Pepe_1 / gradio_interface.py
nileshhanotia's picture
Create gradio_interface.py
5288f83 verified
raw
history blame
872 Bytes
import gradio as gr
from utils.logger import setup_logger
logger = setup_logger(__name__)
class GradioInterface:
def __init__(self, unified_system):
self.unified_system = unified_system
def create_interface(self):
try:
return gr.Interface(
fn=self.unified_system.process_query,
inputs=gr.Textbox(
label="Enter your query",
placeholder="e.g., 'Show me all T-shirts' or 'Describe the product features'"
),
outputs=gr.Textbox(label="Response"),
title="Unified Query Processing System",
description="Enter a natural language query to search products or get descriptions."
)
except Exception as e:
logger.error(f"Failed to create interface: {str(e)}")
raise