|
|
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""" |
|
|
|
|
|
|
|
|
threading.Thread(target=launch_streamlit, daemon=True).start() |
|
|
|
|
|
|
|
|
time.sleep(5) |
|
|
|
|
|
|
|
|
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") |
|
|
|