Skip to content

Commit

Permalink
Ran black on models.py as suggested
Browse files Browse the repository at this point in the history
  • Loading branch information
falquaddoomi committed Oct 23, 2024
1 parent cdca3b8 commit 9a2d11b
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions libs/manubot_ai_editor/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 9a2d11b

Please sign in to comment.