From 9a2d11b7977b12ff50c6e51f0c32d0800229cd77 Mon Sep 17 00:00:00 2001 From: Faisal Alquaddoomi Date: Wed, 23 Oct 2024 13:19:47 -0600 Subject: [PATCH] Ran black on models.py as suggested --- libs/manubot_ai_editor/models.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/libs/manubot_ai_editor/models.py b/libs/manubot_ai_editor/models.py index 7191e9f..4096969 100644 --- a/libs/manubot_ai_editor/models.py +++ b/libs/manubot_ai_editor/models.py @@ -270,7 +270,6 @@ def __init__( **self.model_parameters, ) - def get_prompt( self, paragraph_text: str, section_name: str = None, resolved_prompt: str = None ) -> str | tuple[str, str]: @@ -520,7 +519,9 @@ def get_params(self, paragraph_text, section_name, resolved_prompt=None): return params - def revise_paragraph(self, paragraph_text: str, section_name: str = None, resolved_prompt=None): + def revise_paragraph( + self, paragraph_text: str, section_name: str = None, resolved_prompt=None + ): """ It revises a paragraph using GPT-3 completion model. @@ -550,9 +551,11 @@ def revise_paragraph(self, paragraph_text: str, section_name: str = None, resolv # map the messages to langchain's message types # based on the 'role' field prompt = [ - HumanMessage(content=msg["content"]) - if msg["role"] == "user" else - SystemMessage(content=msg["content"]) + ( + HumanMessage(content=msg["content"]) + if msg["role"] == "user" + else SystemMessage(content=msg["content"]) + ) for msg in params["messages"] ] elif "instruction" in params: @@ -631,10 +634,10 @@ class DebuggingManuscriptRevisionModel(GPT3CompletionModel): """ def __init__(self, *args, **kwargs): - if 'title' not in kwargs or kwargs['title'] is None: - kwargs['title'] = "Debugging Title" - if 'keywords' not in kwargs or kwargs['keywords'] is None: - kwargs['keywords'] = ["debugging", "keywords"] + if "title" not in kwargs or kwargs["title"] is None: + kwargs["title"] = "Debugging Title" + if "keywords" not in kwargs or kwargs["keywords"] is None: + kwargs["keywords"] = ["debugging", "keywords"] super().__init__(*args, **kwargs)