import streamlit as st import os from dotenv import load_dotenv from drone import drone_chat # Load environment variables from .env file load_dotenv() # Add dark theme CSS right at the beginning st.markdown( """ """, unsafe_allow_html=True ) # Page config is set in drone_chat.py at module level # Remove duplicate page config since it's now in drone_chat.py at module level # We'll just import the module and call its main function def show_auth_screen(): """Display the authentication screen with DeepDrone information""" # Military-style header st.markdown("

DEEPDRONE COMMAND CENTER

", unsafe_allow_html=True) st.markdown("

SECURE TACTICAL OPERATIONS INTERFACE

", unsafe_allow_html=True) # Create a centered container for the auth form st.markdown("
", unsafe_allow_html=True) st.markdown("
", unsafe_allow_html=True) st.markdown("

SYSTEM AUTHENTICATION REQUIRED

", unsafe_allow_html=True) # System status information in a more compact layout cols = st.columns(2) with cols[0]: st.markdown("""
SYSTEM STATUS: STANDBY
DATABASE: CONNECTED
SECURITY: ENABLED
""", unsafe_allow_html=True) with cols[1]: st.markdown("""
PROTOCOL: HF-AUTH-1
ENCRYPTION: AES-256
AI MODULE: OFFLINE
""", unsafe_allow_html=True) # Compact information about DeepDrone st.markdown("""

DEEPDRONE is an advanced command and control system for drone operations:

  • Real-time flight data analysis and visualization
  • Comprehensive sensor monitoring with anomaly detection
  • AI-powered mission planning and execution
  • Predictive maintenance scheduling and diagnostics
""", unsafe_allow_html=True) st.markdown("
", unsafe_allow_html=True) # Token input with custom styling st.markdown("

ENTER HUGGING FACE AUTHENTICATION TOKEN FOR THE LLM TO RUN:

", unsafe_allow_html=True) # Create a container with dark background for the input st.markdown("
", unsafe_allow_html=True) api_key = st.text_input("HF Token", type="password", placeholder="Enter Hugging Face API token...", label_visibility="collapsed") st.markdown("
", unsafe_allow_html=True) # Submit button with custom styling if st.button("AUTHORIZE ACCESS"): if api_key: os.environ["HF_TOKEN"] = api_key st.markdown("
AUTHENTICATION SUCCESSFUL - INITIALIZING SYSTEM
", unsafe_allow_html=True) st.session_state['authenticated'] = True st.rerun() st.markdown("
", unsafe_allow_html=True) # Close text-align center div st.markdown("
", unsafe_allow_html=True) # Close auth-container div def main(): # Add CSS styles st.markdown( """ """, unsafe_allow_html=True ) # Check if user is authenticated if not os.environ.get("HF_TOKEN") and not st.session_state.get('authenticated', False): show_auth_screen() return # Run the drone chat application drone_chat.main() if __name__ == "__main__": main()