Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -133,5 +133,11 @@ def main():
|
|
| 133 |
|
| 134 |
if __name__ == "__main__":
|
| 135 |
app = main()
|
| 136 |
-
|
| 137 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 133 |
|
| 134 |
if __name__ == "__main__":
|
| 135 |
app = main()
|
| 136 |
+
try:
|
| 137 |
+
# Automatically find an available port in the range 7860-7870
|
| 138 |
+
port = find_free_port(7860, 7870)
|
| 139 |
+
print(f"Launching on port: {port}")
|
| 140 |
+
app.launch(server_port=port, debug=True)
|
| 141 |
+
except Exception as e:
|
| 142 |
+
print(f"Failed to launch: {str(e)}")
|
| 143 |
+
|