#!/usr/bin/env python3 """ Hugging Face Spaces Entry Point for Corpus Collection Engine AI-powered platform for preserving Indian cultural heritage """ import gradio as gr import subprocess import threading import time import sys import os def launch_streamlit(): """Launch Streamlit app in background""" try: # Launch the Streamlit app from the corpus_collection_engine directory subprocess.Popen([ sys.executable, "-m", "streamlit", "run", "corpus_collection_engine/main.py", "--server.port=7861", "--server.address=0.0.0.0", "--server.headless=true" ]) except Exception as e: print(f"Error launching Streamlit: {e}") def create_interface(): """Create Gradio interface that embeds the Streamlit app""" # Launch Streamlit in background streamlit_thread = threading.Thread(target=launch_streamlit, daemon=True) streamlit_thread.start() # Wait for Streamlit to start time.sleep(10) # Create Gradio interface with gr.Blocks( title="🇮🇳 Corpus Collection Engine", theme=gr.themes.Soft(), css=""" .gradio-container { max-width: 100% !important; padding: 0 !important; } iframe { border-radius: 10px !important; } """ ) as demo: # Header gr.HTML("""

🇮🇳 Corpus Collection Engine

AI-powered platform for preserving Indian cultural heritage

No login required • Start contributing immediately

""") # Main app iframe gr.HTML("""
""") # Features showcase gr.HTML("""

🎯 Cultural Activities Available

🎭

Meme Creator

Create culturally relevant memes in Indian languages

🍛

Recipe Collector

Share traditional family recipes with cultural context

📚

Folklore Archive

Preserve stories, legends, and oral traditions

🏛️

Landmark Identifier

Document historical and cultural landmarks

🌟 Platform Features

🌍 11 Indian Languages📱 Mobile Responsive🔒 Privacy-First Design📊 Real-time Analytics🏆 Achievement System⚡ Offline Support

""") # Footer gr.HTML("""

Built with ❤️ for preserving Indian cultural heritage • Start contributing today!

""") return demo if __name__ == "__main__": # Create and launch the Gradio interface demo = create_interface() demo.launch( server_port=7860, server_name="0.0.0.0", share=False, show_error=True, show_api=False )