Tree: Format
Signed-off-by: kingbri <8082010+kingbri1@users.noreply.github.com>
This commit is contained in:
parent
fa534fe551
commit
0858b6d4b2
5 changed files with 11 additions and 13 deletions
|
|
@ -95,8 +95,11 @@ class ExLlamaV2Grammar:
|
||||||
# Validate KBNF and create formatter
|
# Validate KBNF and create formatter
|
||||||
f = FormatterBuilder()
|
f = FormatterBuilder()
|
||||||
f.append_line(
|
f.append_line(
|
||||||
f"""{f.extractor(lambda nonterminal:
|
f"""{
|
||||||
CFGExtractor(nonterminal, kbnf_string))}"""
|
f.extractor(
|
||||||
|
lambda nonterminal: CFGExtractor(nonterminal, kbnf_string)
|
||||||
|
)
|
||||||
|
}"""
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
logger.error(
|
logger.error(
|
||||||
|
|
|
||||||
|
|
@ -151,8 +151,7 @@ async def load_model_gen(model_path: pathlib.Path, **kwargs):
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"Invalid backend '{backend}'. "
|
f"Invalid backend '{backend}'. Available backends: {available_backends}"
|
||||||
f"Available backends: {available_backends}"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
logger.info(f"Using backend {backend}")
|
logger.info(f"Using backend {backend}")
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,7 @@ async def stream_generation(data: GenerateRequest, request: Request):
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
yield get_generator_error(
|
yield get_generator_error(
|
||||||
f"Kobold generation {data.genkey} aborted. "
|
f"Kobold generation {data.genkey} aborted. Please check the server console."
|
||||||
"Please check the server console."
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,7 @@ class EmbeddingsRequest(BaseModel):
|
||||||
)
|
)
|
||||||
encoding_format: str = Field(
|
encoding_format: str = Field(
|
||||||
"float",
|
"float",
|
||||||
description="Encoding format for the embeddings. "
|
description="Encoding format for the embeddings. Can be 'float' or 'base64'.",
|
||||||
"Can be 'float' or 'base64'.",
|
|
||||||
)
|
)
|
||||||
model: Optional[str] = Field(
|
model: Optional[str] = Field(
|
||||||
None,
|
None,
|
||||||
|
|
@ -31,7 +30,7 @@ class EmbeddingObject(BaseModel):
|
||||||
..., description="Embedding values as a list of floats."
|
..., description="Embedding values as a list of floats."
|
||||||
)
|
)
|
||||||
index: int = Field(
|
index: int = Field(
|
||||||
..., description="Index of the input text corresponding to " "the embedding."
|
..., description="Index of the input text corresponding to the embedding."
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,16 +7,14 @@ successful_packages = []
|
||||||
errored_packages = []
|
errored_packages = []
|
||||||
|
|
||||||
if find_spec("flash_attn") is not None:
|
if find_spec("flash_attn") is not None:
|
||||||
print(
|
print(f"Flash attention on version {version('flash_attn')} successfully imported")
|
||||||
f"Flash attention on version {version('flash_attn')} " "successfully imported"
|
|
||||||
)
|
|
||||||
successful_packages.append("flash_attn")
|
successful_packages.append("flash_attn")
|
||||||
else:
|
else:
|
||||||
print("Flash attention 2 is not found in your environment.")
|
print("Flash attention 2 is not found in your environment.")
|
||||||
errored_packages.append("flash_attn")
|
errored_packages.append("flash_attn")
|
||||||
|
|
||||||
if find_spec("exllamav2") is not None:
|
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")
|
successful_packages.append("exllamav2")
|
||||||
else:
|
else:
|
||||||
print("Exllamav2 is not found in your environment.")
|
print("Exllamav2 is not found in your environment.")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue