-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·31 lines (26 loc) · 843 Bytes
/
main.py
File metadata and controls
executable file
·31 lines (26 loc) · 843 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Hyper-RVC WebUI – legacy entry point.
This file is kept for backward compatibility. The actual WebUI code now
lives in ``app.py``. Running ``python main.py`` will redirect to
``app.py`` automatically.
"""
import sys
import os
# Run the new app module instead
os.chdir(os.path.dirname(os.path.abspath(__file__)))
sys.argv = sys.argv # preserve CLI args
from app import * # noqa: F401, F403
if __name__ == "__main__":
port = get_port_from_args()
for _ in range(MAX_PORT_ATTEMPTS):
try:
launch(port)
break
except OSError:
print(
f"Failed to launch on port {port}, trying again on port {port - 1}..."
)
port -= 1
except Exception as error:
print(f"An error occurred launching Gradio: {error}")
break