import gradio as gr import os from dataset_loader import load_dataset from dotenv import load_dotenv load_dotenv() if not os.path.isdir("cytron_recommendation_chatbot_data"): load_dataset() from cytron_recommendation_chatbot_data.utils import run_conversation # Initialize the conversation conversation = [] def respond_to_input(user_input): response = run_conversation(user_input) return response # Create the Gradio interface iface = gr.Interface( title="Cytron Chatbot", fn=respond_to_input, inputs="text", outputs="text", description=( "This is a chatbot for Cytron Technologies. Ask me anything related to electronics for projects!\n\n" "Note: This chatbot does not implement memory module, ask specific questions and don't expect it to remember previous conversation.\n" ), ) # Launch the app iface.launch()