Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
echarlaix committed Feb 12, 2025
1 parent cfb3aa3 commit e4110d1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions optimum/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ def find_files_matching_pattern(
pattern = re.compile(f"{subfolder}{os.sep}{pattern}" if subfolder != "" else pattern)
files = Path(model_path).glob(glob_pattern)
files = [p for p in files if re.search(pattern, str(p))]


if not files:
raise ValueError(f"model_path {model_path}, glob_pattern {glob_pattern}, Path(model_path).glob(glob_pattern) {[p for p in Path(model_path).glob(glob_pattern) ]}, pattern {pattern}")


else:
pattern = re.compile(f"{subfolder}/{pattern}" if subfolder != "" else pattern)
repo_files = huggingface_hub.list_repo_files(model_path, revision=revision, token=token)
Expand Down

0 comments on commit e4110d1

Please sign in to comment.