From 9b077d27b81750aabbbb1e4987933f79f58d7883 Mon Sep 17 00:00:00 2001 From: Massimiliano Pippi Date: Wed, 2 Oct 2024 08:47:11 +0200 Subject: [PATCH] fix linting --- src/banks/env.py | 2 +- src/banks/extensions/chat.py | 2 +- tests/test_prompt.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/banks/env.py b/src/banks/env.py index 8937a32..ba1ef73 100644 --- a/src/banks/env.py +++ b/src/banks/env.py @@ -13,9 +13,9 @@ def _add_extensions(_env): For example, we use banks to manage the system prompt in `GenerateExtension` """ + from .extensions.chat import ChatMessage # pylint: disable=import-outside-toplevel from .extensions.generate import GenerateExtension # pylint: disable=import-outside-toplevel from .extensions.inference_endpoint import HFInferenceEndpointsExtension # pylint: disable=import-outside-toplevel - from .extensions.chat import ChatMessage _env.add_extension(GenerateExtension) _env.add_extension(HFInferenceEndpointsExtension) diff --git a/src/banks/extensions/chat.py b/src/banks/extensions/chat.py index c3590d0..8747b77 100644 --- a/src/banks/extensions/chat.py +++ b/src/banks/extensions/chat.py @@ -40,7 +40,7 @@ def parse(self, parser): # Anything else is a parse error error_msg = f"Invalid syntax for chat attribute, got '{gathered}', expected role=\"value\"" try: - attr_name, attr_assign, attr_value = gathered + attr_name, attr_assign, attr_value = gathered # pylint: disable=unbalanced-tuple-unpacking except ValueError: raise TemplateSyntaxError(error_msg, lineno) from None diff --git a/tests/test_prompt.py b/tests/test_prompt.py index 21ab0be..366c482 100644 --- a/tests/test_prompt.py +++ b/tests/test_prompt.py @@ -5,7 +5,7 @@ import regex as re from jinja2 import Environment -from banks import AsyncPrompt, Prompt, ChatMessage +from banks import AsyncPrompt, ChatMessage, Prompt from banks.cache import DefaultCache from banks.errors import AsyncError