enotkrutoy/CodeReviewAgent
0
1#!/usr/bin/env python32# -*- coding: utf-8 -*-3 4"""5Code Review Agent - Hugging Face Spaces Entry Point6 7This module serves as the entry point for the Code Review Agent application8when deployed to Hugging Face Spaces.9"""10 11import os12import sys13import logging14from dotenv import load_dotenv15 16# Add the project root to the Python path17sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))18 19# Import application modules20from src.ui.gradio_app import create_gradio_app21from src.core.agent_manager import AgentManager22 23# Configure logging24logging.basicConfig(25 level=logging.INFO,26 format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',27 handlers=[28 logging.StreamHandler()29 ]30)31 32logger = logging.getLogger(__name__)33 34# Load environment variables35load_dotenv()36 37# Create logs directory if it doesn't exist38logs_dir = os.path.join(os.path.dirname(__file__), 'logs')39os.makedirs(logs_dir, exist_ok=True)40 41# Initialize the agent manager42agent_manager = AgentManager()43 44# Create the Gradio app45app = create_gradio_app(agent_manager)46 47# Launch the app with specific server configuration for Hugging Face Spaces48app.launch(server_name="0.0.0.0", server_port=7860, share=False)