use robust envs

Former-commit-id: f3e194c3b3c40a3e6c3c5397ec0d859e6db614b5
This commit is contained in:
hiyouga
2024-05-14 21:36:42 +08:00
parent 84ff56c3a0
commit 6670b36c49
5 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ from llmtuner.webui.interface import create_ui
def main():
gradio_share = bool(int(os.environ.get("GRADIO_SHARE", "0")))
gradio_share = os.environ.get("GRADIO_SHARE", "0").lower() in ["true", "1"]
server_name = os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0")
create_ui().queue().launch(share=gradio_share, server_name=server_name)