James Frecheville
commited on
Commit
·
0b142d7
1
Parent(s):
9a3b38c
Disable browser installation and update launch configuration
Browse files
app.py
CHANGED
@@ -1,16 +1,26 @@
|
|
1 |
import os
|
2 |
import sys
|
3 |
-
import gradio as gr
|
4 |
from pathlib import Path
|
5 |
|
6 |
-
# Add
|
7 |
current_dir = Path(__file__).parent.absolute()
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
from owl.webapp import create_ui
|
11 |
|
12 |
-
# Create
|
13 |
demo = create_ui()
|
14 |
|
15 |
-
#
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import os
|
2 |
import sys
|
|
|
3 |
from pathlib import Path
|
4 |
|
5 |
+
# Add current directory to Python path
|
6 |
current_dir = Path(__file__).parent.absolute()
|
7 |
+
if str(current_dir) not in sys.path:
|
8 |
+
sys.path.append(str(current_dir))
|
9 |
+
|
10 |
+
# Disable browser installation
|
11 |
+
os.environ["GRADIO_ANALYTICS_ENABLED"] = "false"
|
12 |
+
os.environ["GRADIO_BROWSER_INSTALLED"] = "true"
|
13 |
|
14 |
from owl.webapp import create_ui
|
15 |
|
16 |
+
# Create Gradio interface
|
17 |
demo = create_ui()
|
18 |
|
19 |
+
# Launch the app
|
20 |
+
if __name__ == "__main__":
|
21 |
+
demo.launch(
|
22 |
+
server_name="0.0.0.0",
|
23 |
+
server_port=7861,
|
24 |
+
share=False,
|
25 |
+
show_error=True
|
26 |
+
)
|