Skip to content

Commit

Permalink
[Bugfix] Fix HfExampleModels.find_hf_info (#12223)
Browse files Browse the repository at this point in the history
Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
  • Loading branch information
DarkLight1337 authored Jan 20, 2025
1 parent 86bfb6d commit 18572e3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/models/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ def find_hf_info(self, model_id: str) -> _HfExamplesInfo:
if info.default == model_id:
return info

# Fallback to extras
for info in self.hf_models.values():
if any(extra == model_id for extra in info.extras.values()):
return info

raise ValueError(f"No example model defined for {model_id}")


Expand Down

0 comments on commit 18572e3

Please sign in to comment.