Tree: Format

Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
kingbri 2025-05-17 00:46:40 -04:00
parent fa534fe551
commit 0858b6d4b2
5 changed files with 11 additions and 13 deletions

View file

@ -95,8 +95,11 @@ class ExLlamaV2Grammar:
# Validate KBNF and create formatter
f = FormatterBuilder()
f.append_line(
f"""{f.extractor(lambda nonterminal:
CFGExtractor(nonterminal, kbnf_string))}"""
f"""{
f.extractor(
lambda nonterminal: CFGExtractor(nonterminal, kbnf_string)
)
}"""
)
except Exception:
logger.error(

View file

@ -151,8 +151,7 @@ async def load_model_gen(model_path: pathlib.Path, **kwargs):
)
else:
raise ValueError(
f"Invalid backend '{backend}'. "
f"Available backends: {available_backends}"
f"Invalid backend '{backend}'. Available backends: {available_backends}"
)
logger.info(f"Using backend {backend}")

View file

@ -103,8 +103,7 @@ async def stream_generation(data: GenerateRequest, request: Request):
)
except Exception:
yield get_generator_error(
f"Kobold generation {data.genkey} aborted. "
"Please check the server console."
f"Kobold generation {data.genkey} aborted. Please check the server console."
)

View file

@ -15,8 +15,7 @@ class EmbeddingsRequest(BaseModel):
)
encoding_format: str = Field(
"float",
description="Encoding format for the embeddings. "
"Can be 'float' or 'base64'.",
description="Encoding format for the embeddings. Can be 'float' or 'base64'.",
)
model: Optional[str] = Field(
None,
@ -31,7 +30,7 @@ class EmbeddingObject(BaseModel):
..., description="Embedding values as a list of floats."
)
index: int = Field(
..., description="Index of the input text corresponding to " "the embedding."
..., description="Index of the input text corresponding to the embedding."
)

View file

@ -7,16 +7,14 @@ successful_packages = []
errored_packages = []
if find_spec("flash_attn") is not None:
print(
f"Flash attention on version {version('flash_attn')} " "successfully imported"
)
print(f"Flash attention on version {version('flash_attn')} successfully imported")
successful_packages.append("flash_attn")
else:
print("Flash attention 2 is not found in your environment.")
errored_packages.append("flash_attn")
if find_spec("exllamav2") is not None:
print(f"Exllamav2 on version {version('exllamav2')} " "successfully imported")
print(f"Exllamav2 on version {version('exllamav2')} successfully imported")
successful_packages.append("exllamav2")
else:
print("Exllamav2 is not found in your environment.")