From 6c16e4cecf8573f9c2b4e2793d83d59b67ee332e Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 29 Aug 2023 16:35:44 -0700 Subject: [PATCH] Cloudfare fix Credits: https://github.com/oobabooga/text-generation-webui/issues/1524#issuecomment-1698255209 --- extensions/api/script.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/extensions/api/script.py b/extensions/api/script.py index 80617b3e..e57aac92 100644 --- a/extensions/api/script.py +++ b/extensions/api/script.py @@ -1,3 +1,5 @@ +import time + import extensions.api.blocking_api as blocking_api import extensions.api.streaming_api as streaming_api from modules import shared @@ -5,4 +7,7 @@ from modules import shared 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)