File size: 835 Bytes
127b728
1380137
127b728
 
b7367c9
127b728
 
 
 
 
 
 
 
 
73432f0
127b728
4ab43b4
127b728
 
4ab43b4
 
 
127b728
 
4ab43b4
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
import logging
from utils.chatbot_interface import ChatbotInterface  

# Configure logging to both file and console
log_file_path = "logs/chatbot.log"
logging.basicConfig(
    level=logging.INFO,
    format="%(asctime)s - %(levelname)s - %(message)s",
    handlers=[
        logging.FileHandler(log_file_path, mode='a', encoding='utf-8'),  # Save logs to a file
        logging.StreamHandler()  # Print logs to the console
    ]
)

if __name__ == "__main__":
    try:
        # Instantiate the ChatbotInterface class and create the interface
        chatbot_interface = ChatbotInterface()
        demo = chatbot_interface.create_interface()

        # Launch the Gradio interface
        logging.info("Launching the Gradio interface...")
        demo.launch()
    except Exception as e:
        logging.error(f"An error occurred: {e}")