Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v3] Fix crash from inferring the dataset_id from a local dataset #2636

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion sentence_transformers/model_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,13 @@ def subtuple_finder(tuple: Tuple[str], subtuple: Tuple[str]) -> int:
else:
author = None
dataset_name = cache_dataset_name
dataset_output["id"] = get_dataset_info(dataset_name).id
# We can still be dealing with a local dataset here, so we wrap this with try-except
try:
dataset_output["id"] = get_dataset_info(dataset_name).id
except Exception:
# We can have a wide range of errors here, such as the dataset not existing, no internet, etc.
# So we use the generic Exception
pass

# If the cache path ends with a 40 character hash, it is the current revision
if len(cache_path_parts[-2]) == 40:
Expand Down
Loading