Skip to content

Commit

Permalink
try main if tag does not work (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
lvwerra authored Oct 13, 2022
1 parent 039a77c commit cb2a7f0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/evaluate/loading.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,15 @@ def get_module(self) -> ImportableModule:
revision = "v" + revision # tagging convention on evaluate repository starts with v

# get script and other files
local_path = self.download_loading_script(revision)
try:
local_path = self.download_loading_script(revision)
except FileNotFoundError as err:
# if there is no file found with current revision tag try to load main
if self.revision is None and os.getenv("HF_SCRIPTS_VERSION", SCRIPTS_VERSION) != "main":
revision = "main"
local_path = self.download_loading_script(revision)
else:
raise err

imports = get_imports(local_path)
local_imports = _download_additional_modules(
Expand Down

0 comments on commit cb2a7f0

Please sign in to comment.