fix: mypy/black

This commit is contained in:
Javier Martinez 2024-09-26 09:40:24 +02:00
parent 0cd016a732
commit 4b5c3362f1
No known key found for this signature in database
4 changed files with 20 additions and 18 deletions

View File

@ -286,8 +286,9 @@ class ChatMLPromptStyle(AbstractPromptStyle):
def get_prompt_style(
prompt_style: Literal["default", "llama2", "llama3", "tag", "mistral", "chatml"]
| None
prompt_style: (
Literal["default", "llama2", "llama3", "tag", "mistral", "chatml"] | None
)
) -> AbstractPromptStyle:
"""Get the prompt style to use from the given string.

View File

@ -90,9 +90,9 @@ class SummarizeService:
# Add context documents to summarize
if use_context:
# 1. Recover all ref docs
ref_docs: dict[
str, RefDocInfo
] | None = self.storage_context.docstore.get_all_ref_doc_info()
ref_docs: dict[str, RefDocInfo] | None = (
self.storage_context.docstore.get_all_ref_doc_info()
)
if ref_docs is None:
raise ValueError("No documents have been ingested yet.")

View File

@ -136,9 +136,8 @@ class LLMSettings(BaseModel):
0.1,
description="The temperature of the model. Increasing the temperature will make the model answer more creatively. A value of 0.1 would be more factual.",
)
prompt_style: Literal[
"default", "llama2", "llama3", "tag", "mistral", "chatml"
] = Field(
prompt_style: Literal["default", "llama2", "llama3", "tag", "mistral", "chatml"] = (
Field(
"llama2",
description=(
"The prompt style to use for the chat engine. "
@ -150,6 +149,7 @@ class LLMSettings(BaseModel):
"`llama2` is the historic behaviour. `default` might work better with your custom models."
),
)
)
class VectorstoreSettings(BaseModel):

View File

@ -1,4 +1,5 @@
"""This file should be imported if and only if you want to run the UI locally."""
import base64
import logging
import time