mirror of
https://github.com/theroyallab/tabbyAPI.git
synced 2026-04-28 10:11:39 +00:00
@@ -125,8 +125,7 @@ class BaseSamplerRequest(BaseModel):
|
|||||||
"rep_pen_range",
|
"rep_pen_range",
|
||||||
),
|
),
|
||||||
description=(
|
description=(
|
||||||
"Aliases: repetition_range, repetition_penalty_range, "
|
"Aliases: repetition_range, repetition_penalty_range, " "rep_pen_range"
|
||||||
"rep_pen_range"
|
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ class HuggingFaceConfig(BaseModel):
|
|||||||
"""Create an instance from a generation config file."""
|
"""Create an instance from a generation config file."""
|
||||||
|
|
||||||
hf_config_path = model_directory / "config.json"
|
hf_config_path = model_directory / "config.json"
|
||||||
with open(
|
with open(hf_config_path, "r", encoding="utf8") as hf_config_json:
|
||||||
hf_config_path, "r", encoding="utf8"
|
|
||||||
) as hf_config_json:
|
|
||||||
hf_config_dict = json.load(hf_config_json)
|
hf_config_dict = json.load(hf_config_json)
|
||||||
return self.model_validate(hf_config_dict)
|
return self.model_validate(hf_config_dict)
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class GenerateRequest(BaseSamplerRequest):
|
|||||||
if self.use_default_badwordsids:
|
if self.use_default_badwordsids:
|
||||||
bad_words_ids = unwrap(
|
bad_words_ids = unwrap(
|
||||||
model.container.generation_config.bad_words_ids,
|
model.container.generation_config.bad_words_ids,
|
||||||
model.container.hf_config.get_badwordsids()
|
model.container.hf_config.get_badwordsids(),
|
||||||
)
|
)
|
||||||
|
|
||||||
if bad_words_ids:
|
if bad_words_ids:
|
||||||
|
|||||||
Reference in New Issue
Block a user