From 29aaa7b31bc9f2aecb6d30522e67fd404d41e325 Mon Sep 17 00:00:00 2001 From: Dhruv Nair Date: Thu, 29 Feb 2024 12:25:47 +0000 Subject: [PATCH] update --- src/diffusers/doctest_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/diffusers/doctest_utils.py b/src/diffusers/doctest_utils.py index ac98f5c632ce..2157db4ac2b5 100644 --- a/src/diffusers/doctest_utils.py +++ b/src/diffusers/doctest_utils.py @@ -42,7 +42,7 @@ def preprocess_string(string, skip_cuda_tests): cuda stuff is detective (with a heuristic), this method will return an empty string so no doctest will be run for `string`. """ - codeblock_pattern = r"(```(?:python|py)\s*\n\s*>>> )((?:.*?\n)*?.*?```)" + codeblock_pattern = r"(```(?:python|py)\s*\n\s*>>> )((?:(?!```)[^])*?```)" codeblocks = re.split(re.compile(codeblock_pattern, flags=re.MULTILINE | re.DOTALL), string) is_cuda_found = False for i, codeblock in enumerate(codeblocks):