deberta-v2 support (provisional), fix remote_code
This commit is contained in:
parent
31fe882eff
commit
43da40b091
1 changed files with 4 additions and 7 deletions
|
|
@ -618,19 +618,16 @@ class FastSentenceTransformer(FastModel):
|
|||
transformers4 = Version(transformers.__version__).major < 5
|
||||
model_type = ""
|
||||
try:
|
||||
config = AutoConfig.from_pretrained(model_name, token = token)
|
||||
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
|
||||
):
|
||||
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