text-generation-webui/extensions/api/script.py

14 lines
466 B
Python
Raw Normal View History

import time
import extensions.api.blocking_api as blocking_api
import extensions.api.streaming_api as streaming_api
2023-03-15 21:52:46 +01:00
from modules import shared
2023-05-20 23:42:17 +02:00
2023-03-19 14:22:24 +01:00
def setup():
blocking_api.start_server(shared.args.api_blocking_port, share=shared.args.public_api, tunnel_id=shared.args.public_api_id)
if shared.public_api:
time.sleep(5)
streaming_api.start_server(shared.args.api_streaming_port, share=shared.args.public_api, tunnel_id=shared.args.public_api_id)