forked from p04798526/LLaMA-Factory-Mirror
fix gradio args
This commit is contained in:
parent
c8cd00bec6
commit
a153039380
|
@ -1,3 +1,5 @@
|
|||
import os
|
||||
|
||||
from ..extras.packages import is_gradio_available
|
||||
from .common import save_config
|
||||
from .components import (
|
||||
|
@ -69,8 +71,14 @@ def create_web_demo() -> gr.Blocks:
|
|||
|
||||
|
||||
def run_web_ui() -> None:
|
||||
create_ui().queue().launch()
|
||||
server_name = os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0")
|
||||
server_port = int(os.environ.get("GRADIO_SERVER_PORT", "7860"))
|
||||
gradio_share = bool(int(os.environ.get("GRADIO_SHARE", "0")))
|
||||
create_ui().queue().launch(share=gradio_share, server_name=server_name, server_port=server_port)
|
||||
|
||||
|
||||
def run_web_demo() -> None:
|
||||
create_web_demo().queue().launch()
|
||||
server_name = os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0")
|
||||
server_port = int(os.environ.get("GRADIO_SERVER_PORT", "7860"))
|
||||
gradio_share = bool(int(os.environ.get("GRADIO_SHARE", "0")))
|
||||
create_web_demo().queue().launch(share=gradio_share, server_name=server_name, server_port=server_port)
|
||||
|
|
|
@ -1,8 +1,13 @@
|
|||
import os
|
||||
|
||||
from llmtuner.webui.interface import create_ui
|
||||
|
||||
|
||||
def main():
|
||||
create_ui().queue().launch(server_name="0.0.0.0", server_port=None, share=False)
|
||||
server_name = os.environ.get("GRADIO_SERVER_NAME", "0.0.0.0")
|
||||
server_port = int(os.environ.get("GRADIO_SERVER_PORT", "7860"))
|
||||
gradio_share = bool(int(os.environ.get("GRADIO_SHARE", "0")))
|
||||
create_ui().queue().launch(share=gradio_share, server_name=server_name, server_port=server_port)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Reference in New Issue