#!/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("""
AI-powered platform for preserving Indian cultural heritage
No login required • Start contributing immediately
Create culturally relevant memes in Indian languages
Share traditional family recipes with cultural context
Preserve stories, legends, and oral traditions
Document historical and cultural landmarks
🌍 11 Indian Languages • 📱 Mobile Responsive • 🔒 Privacy-First Design • 📊 Real-time Analytics • 🏆 Achievement System • ⚡ Offline Support
Built with ❤️ for preserving Indian cultural heritage • Start contributing today!