[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
43da40b091
commit
b6f65d1aa5
1 changed files with 10 additions and 3 deletions
|
|
@ -618,16 +618,23 @@ class FastSentenceTransformer(FastModel):
|
|||
transformers4 = Version(transformers.__version__).major < 5
|
||||
model_type = ""
|
||||
try:
|
||||
config = AutoConfig.from_pretrained(model_name, token=token, trust_remote_code=trust_remote_code)
|
||||
config = AutoConfig.from_pretrained(
|
||||
model_name, token = token, trust_remote_code = trust_remote_code
|
||||
)
|
||||
model_type = getattr(config, "model_type", "")
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
is_distilbert = "distilbert" == model_type.lower()
|
||||
is_modernbert = "modernbert" == model_type.lower()
|
||||
is_debertav2 = "deberta-v2" == model_type.lower()
|
||||
|
||||
if "add_pooling_layer" not in kwargs and not is_distilbert and not is_modernbert and not is_debertav2:
|
||||
if (
|
||||
"add_pooling_layer" not in kwargs
|
||||
and not is_distilbert
|
||||
and not is_modernbert
|
||||
and not is_debertav2
|
||||
):
|
||||
kwargs["add_pooling_layer"] = False
|
||||
|
||||
# forces fp8 to be False since it's not supported
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue