Files
HadTavern/run_server.py
2025-09-07 22:33:51 +03:00

20 lines
392 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import os
import webbrowser
def main() -> None:
port = int(os.environ.get("PORT", "7860"))
url = f"http://127.0.0.1:{port}/"
print(f"Starting НадTavern on {url}")
try:
# Open browser after server is up. We'll rely on .bat to start uvicorn and then open UI.
webbrowser.open(url)
except Exception:
pass
if __name__ == "__main__":
main()