Spaces:
Sleeping
Sleeping
Create main.py
Browse files
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")
|