Unverified Commit 84e00adc authored by Isotr0py's avatar Isotr0py Committed by GitHub
Browse files

[Bugfix] Fix incorrect resolving order for transformers fallback (#15279)


Signed-off-by: default avatarIsotr0py <2037008807@qq.com>
parent 47c71262
...@@ -418,11 +418,13 @@ class _ModelRegistry: ...@@ -418,11 +418,13 @@ class _ModelRegistry:
if not architectures: if not architectures:
logger.warning("No model architectures are specified") logger.warning("No model architectures are specified")
normalized_arch = [] # filter out support architectures
for model in architectures: normalized_arch = list(
if model not in self.models: filter(lambda model: model in self.models, architectures))
model = "TransformersModel"
normalized_arch.append(model) # make sure Transformers fallback are put at the last
if len(normalized_arch) != len(architectures):
normalized_arch.append("TransformersModel")
return normalized_arch return normalized_arch
def inspect_model_cls( def inspect_model_cls(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment