singarajusaiteja's picture
created app.py
a40065e verified
raw
history blame
1.12 kB
import gradio as gr
import subprocess
import threading
import time
import requests
def launch_streamlit():
"""Launch Streamlit in background"""
subprocess.Popen([
"streamlit", "run", "corpus_collection_engine/main.py",
"--server.port=7861", "--server.address=0.0.0.0"
])
def create_interface():
"""Create Gradio interface that embeds Streamlit"""
# Launch Streamlit in background
threading.Thread(target=launch_streamlit, daemon=True).start()
# Wait for Streamlit to start
time.sleep(5)
# Create Gradio interface
with gr.Blocks(title="Corpus Collection Engine") as demo:
gr.HTML("""
<div style="text-align: center; padding: 20px;">
<h1>๐Ÿ‡ฎ๐Ÿ‡ณ Corpus Collection Engine</h1>
<p>AI-powered platform for preserving Indian cultural heritage</p>
<iframe src="http://localhost:7861" width="100%" height="800px" frameborder="0"></iframe>
</div>
""")
return demo
if __name__ == "__main__":
demo = create_interface()
demo.launch(server_port=7860, server_name="0.0.0.0")