adf-chatbot2 / app.py
Yannick Lemin
logging ip address
01802cd
raw
history blame contribute delete
994 Bytes
import gradio as gr
import requests
from src.ui.components import UIComponents
from src.utils.logging import get_logger
# Get logger
logger = get_logger()
# Create UI components
logger.info("Starting ADF Chatbot application")
try:
ui = UIComponents()
# Create and launch the interface
logger.info("Creating Gradio interface")
demo = ui.create_interface()
if __name__ == "__main__":
try:
logger.info("Launching Gradio interface")
logger.info(f"IP = {requests.get('https://api.ipify.org').text}")
demo.launch()
logger.info("Gradio interface closed")
except Exception as e:
logger.error(f"Error during Gradio interface execution: {str(e)}")
raise
finally:
# Ensure resources are properly closed
logger.info("Cleaning up resources")
ui.close()
except Exception as e:
logger.error(f"Error during application startup: {str(e)}")
raise