singarajusaiteja commited on
Commit
8a27e64
ยท
verified ยท
1 Parent(s): 6ad46b7

update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -16
app.py CHANGED
@@ -2,35 +2,30 @@ import gradio as gr
2
  import subprocess
3
  import threading
4
  import time
5
- import requests
6
 
7
  def launch_streamlit():
8
- """Launch Streamlit in background"""
9
  subprocess.Popen([
10
- "streamlit", "run", "corpus_collection_engine/main.py",
11
- "--server.port=7861", "--server.address=0.0.0.0"
 
 
12
  ])
13
 
14
  def create_interface():
15
- """Create Gradio interface that embeds Streamlit"""
16
-
17
- # Launch Streamlit in background
18
  threading.Thread(target=launch_streamlit, daemon=True).start()
 
19
 
20
- # Wait for Streamlit to start
21
- time.sleep(5)
22
-
23
- # Create Gradio interface
24
- with gr.Blocks(title="Corpus Collection Engine") as demo:
25
  gr.HTML("""
26
- <div style="text-align: center; padding: 20px;">
27
  <h1>๐Ÿ‡ฎ๐Ÿ‡ณ Corpus Collection Engine</h1>
28
  <p>AI-powered platform for preserving Indian cultural heritage</p>
29
- <iframe src="http://localhost:7861" width="100%" height="800px" frameborder="0"></iframe>
30
  </div>
31
  """)
32
-
33
- return demo
 
 
34
 
35
  if __name__ == "__main__":
36
  demo = create_interface()
 
2
  import subprocess
3
  import threading
4
  import time
 
5
 
6
  def launch_streamlit():
 
7
  subprocess.Popen([
8
+ "streamlit", "run", "main.py", # โœ… Now at root level
9
+ "--server.port=7861",
10
+ "--server.address=0.0.0.0",
11
+ "--server.headless=true"
12
  ])
13
 
14
  def create_interface():
 
 
 
15
  threading.Thread(target=launch_streamlit, daemon=True).start()
16
+ time.sleep(8)
17
 
18
+ with gr.Blocks(title="๐Ÿ‡ฎ๐Ÿ‡ณ Corpus Collection Engine") as demo:
 
 
 
 
19
  gr.HTML("""
20
+ <div style="text-align: center; padding: 20px; background: linear-gradient(135deg, #FF6B35, #F7931E); color: white; margin-bottom: 20px; border-radius: 10px;">
21
  <h1>๐Ÿ‡ฎ๐Ÿ‡ณ Corpus Collection Engine</h1>
22
  <p>AI-powered platform for preserving Indian cultural heritage</p>
 
23
  </div>
24
  """)
25
+
26
+ gr.HTML('<iframe src="http://localhost:7861" width="100%" height="800px" frameborder="0"></iframe>')
27
+
28
+ return demo
29
 
30
  if __name__ == "__main__":
31
  demo = create_interface()