import sys from pathlib import Path import os import gdown import streamlit as st # Set page config - must be first Streamlit command st.set_page_config( page_title="TruthCheck - Advanced Fake News Detector", page_icon="đĄī¸", layout="wide", initial_sidebar_state="expanded" ) # Custom CSS with Poppins font st.markdown(""" """, unsafe_allow_html=True) MODEL_PATH = "models/saved/final_model.pt" GOOGLE_DRIVE_FILE_ID = "1xhYKuC5_Yri3mm3Ejt-SpB2WAVUTJvc_" GOOGLE_DRIVE_URL = f"https://drive.google.com/uc?id={GOOGLE_DRIVE_FILE_ID}" @st.cache_resource def download_model(): """Download model from Google Drive if not exists.""" if not os.path.exists(MODEL_PATH): os.makedirs(os.path.dirname(MODEL_PATH), exist_ok=True) with st.spinner("Downloading model from Google Drive..."): try: gdown.download(GOOGLE_DRIVE_URL, MODEL_PATH, quiet=False) st.markdown('
', unsafe_allow_html=True) except Exception as e: st.markdown(f' ', unsafe_allow_html=True) st.markdown(' ', unsafe_allow_html=True) return False return True # Add src directory to Python path src_path = Path(__file__).parent / "src" sys.path.append(str(src_path)) # Enhanced Sidebar navigation with icons st.sidebar.markdown("""Advanced Fake News Detector
Protecting you from misinformation with AI-powered detection
Š 2025 TruthCheck | AI-Powered