asdfaman commited on
Commit
64aed4e
·
verified ·
1 Parent(s): 47ad201

Create main.py

Browse files
Files changed (1) hide show
  1. main.py +12 -0
main.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+
3
+ option = os.getenv("APP_OPTION", "gradio")
4
+
5
+ if option == "gradio":
6
+ # Run Gradio app
7
+ from app import create_gradio_interface
8
+ iface = create_gradio_interface()
9
+ iface.launch(server_name="0.0.0.0", server_port=7860)
10
+ elif option == "streamlit":
11
+ # Run Streamlit app
12
+ os.system("streamlit run app1.py --server.port 7860 --server.address 0.0.0.0")