mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Make API URLs more visible
This commit is contained in:
parent
09f807af83
commit
1a34927314
@ -212,7 +212,7 @@ def _run_server(port: int, share: bool = False, tunnel_id=str):
|
|||||||
server.socket = context.wrap_socket(server.socket, server_side=True)
|
server.socket = context.wrap_socket(server.socket, server_side=True)
|
||||||
|
|
||||||
def on_start(public_url: str):
|
def on_start(public_url: str):
|
||||||
logger.info(f'Starting non-streaming server at public url {public_url}/api')
|
logger.info(f'Blocking API URL: \n\n{public_url}/api\n')
|
||||||
|
|
||||||
if share:
|
if share:
|
||||||
try:
|
try:
|
||||||
@ -221,9 +221,9 @@ def _run_server(port: int, share: bool = False, tunnel_id=str):
|
|||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
if ssl_verify:
|
if ssl_verify:
|
||||||
logger.info(f'Starting API at https://{address}:{port}/api')
|
logger.info(f'Blocking API URL: \n\nhttps://{address}:{port}/api\n')
|
||||||
else:
|
else:
|
||||||
logger.info(f'Starting API at http://{address}:{port}/api')
|
logger.info(f'Blocking API URL: \n\nhttp://{address}:{port}/api\n')
|
||||||
|
|
||||||
server.serve_forever()
|
server.serve_forever()
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ def _run_server(port: int, share: bool = False, tunnel_id=str):
|
|||||||
|
|
||||||
def on_start(public_url: str):
|
def on_start(public_url: str):
|
||||||
public_url = public_url.replace('https://', 'wss://')
|
public_url = public_url.replace('https://', 'wss://')
|
||||||
logger.info(f'Starting streaming server at public url {public_url}{PATH}')
|
logger.info(f'Streaming API URL: \n\n{public_url}{PATH}\n')
|
||||||
|
|
||||||
if share:
|
if share:
|
||||||
try:
|
try:
|
||||||
@ -131,9 +131,9 @@ def _run_server(port: int, share: bool = False, tunnel_id=str):
|
|||||||
print(e)
|
print(e)
|
||||||
else:
|
else:
|
||||||
if ssl_verify:
|
if ssl_verify:
|
||||||
logger.info(f'Starting streaming server at wss://{address}:{port}{PATH}')
|
logger.info(f'Streaming API URL: \n\nwss://{address}:{port}{PATH}\n')
|
||||||
else:
|
else:
|
||||||
logger.info(f'Starting streaming server at ws://{address}:{port}{PATH}')
|
logger.info(f'Streaming API URL: \n\nws://{address}:{port}{PATH}\n')
|
||||||
|
|
||||||
asyncio.run(_run(host=address, port=port))
|
asyncio.run(_run(host=address, port=port))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user