"tests/L0/git@developer.sourcefind.cn:OpenDAS/apex.git" did not exist on "5bae299e40f543c7f9ef03b7b5b61daa79115a4b"
Unverified Commit 6a242ada authored by Xiaomeng Zhao's avatar Xiaomeng Zhao Committed by GitHub
Browse files

Merge pull request #2861 from myhloli/dev

feat: add server name and port options to Gradio app for enhanced con…
parents e1972f46 9a16d3c7
...@@ -232,7 +232,24 @@ def update_interface(backend_choice): ...@@ -232,7 +232,24 @@ def update_interface(backend_choice):
help="Set the maximum number of pages to convert from PDF to Markdown.", help="Set the maximum number of pages to convert from PDF to Markdown.",
default=1000, default=1000,
) )
def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compile_enable, api_enable, max_convert_pages): @click.option(
'--server-name',
'server_name',
type=str,
help="Set the server name for the Gradio app.",
default=None,
)
@click.option(
'--server-port',
'server_port',
type=int,
help="Set the server port for the Gradio app.",
default=None,
)
def main(
example_enable, sglang_engine_enable, mem_fraction_static, torch_compile_enable, api_enable, max_convert_pages,
server_name, server_port
):
if sglang_engine_enable: if sglang_engine_enable:
try: try:
print("Start init SgLang engine...") print("Start init SgLang engine...")
...@@ -336,7 +353,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil ...@@ -336,7 +353,7 @@ def main(example_enable, sglang_engine_enable, mem_fraction_static, torch_compil
api_name=api_name api_name=api_name
) )
demo.launch() demo.launch(server_name=server_name, server_port=server_port, show_api=api_enable)
if __name__ == '__main__': if __name__ == '__main__':
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment