From 3a6a04de0a77bdc797896b072ea6c890073a9ee0 Mon Sep 17 00:00:00 2001 From: DiligentCatCat Date: Tue, 13 Jun 2023 14:22:31 +0800 Subject: [PATCH 1/2] fix: missing 'endswith' --- example_modules/demo_modules/stable_diffusion.module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_modules/demo_modules/stable_diffusion.module.py b/example_modules/demo_modules/stable_diffusion.module.py index 9b1261a..6cd0461 100644 --- a/example_modules/demo_modules/stable_diffusion.module.py +++ b/example_modules/demo_modules/stable_diffusion.module.py @@ -28,7 +28,7 @@ def reg_or_not(): if stable_diffusion_address.endswith('/sdapi/v1') or stable_diffusion_address.endswith('/sdapi/v1/'): logger.warn("'STABLE_DIFFUSION_URL' is expected to be something like: http://host[:port], " "the form 'http://host[:port]/sdapi/v1' will be deprecated in the future.") - if stable_diffusion_address('/sdapi/v1'): + if stable_diffusion_address.endswith('/sdapi/v1'): stable_diffusion_address += '/txt2img' else: stable_diffusion_address += 'txt2img' From 5c31f0e2b577d20ecb2c2365166e48baa5a50dfc Mon Sep 17 00:00:00 2001 From: DiligentCatCat Date: Tue, 13 Jun 2023 14:29:27 +0800 Subject: [PATCH 2/2] fix: demo_service1 keeps crashing if DEMO_YOUTUBE_API_KEY is not set --- example_services/demo_service1/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/example_services/demo_service1/main.py b/example_services/demo_service1/main.py index b288fa4..ad42222 100644 --- a/example_services/demo_service1/main.py +++ b/example_services/demo_service1/main.py @@ -23,7 +23,8 @@ load_dotenv() os.environ['OPENAI_API_KEY'] = os.getenv("JARVIS_OPENAI_API_KEY") youtube_api_key = os.getenv("DEMO_YOUTUBE_API_KEY") -youtube_client = build('youtube', 'v3', developerKey=youtube_api_key) +if youtube_api_key is not None and youtube_api_key != '': + youtube_client = build('youtube', 'v3', developerKey=youtube_api_key) youtube_video_max_result = 3 youtube_username_set = set()