16 lines
834 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 23:52:46 +03:00
from modules import shared
from modules.logging_colors import logger
2023-03-15 23:52:46 +03:00
2023-05-20 18:42:17 -03:00
2023-03-19 13:22:24 +00:00
def setup():
2023-11-06 07:17:49 -08:00
logger.warning("\nThe current API is deprecated and will be replaced with the OpenAI compatible API on November 13th.\nTo test the new API, use \"--extensions openai\" instead of \"--api\".\nFor documentation on the new API, consult:\nhttps://github.com/oobabooga/text-generation-webui/wiki/12-%E2%80%90-OpenAI-API")
blocking_api.start_server(shared.args.api_blocking_port, share=shared.args.public_api, tunnel_id=shared.args.public_api_id)
2023-08-29 19:54:43 -07:00
if shared.args.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)