Skip to content

Commit

Permalink
Update hf_github_url
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Jun 19, 2024
1 parent 2285a97 commit 3e76736
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
3 changes: 0 additions & 3 deletions src/datasets/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
CLOUDFRONT_DATASETS_DISTRIB_PREFIX = "https://cdn-datasets.huggingface.co/datasets/datasets"
REPO_DATASETS_URL = "https://raw.githubusercontent.com/huggingface/datasets/{revision}/datasets/{path}/{name}"

# Metrics
REPO_METRICS_URL = "https://raw.githubusercontent.com/huggingface/datasets/{revision}/metrics/{path}/{name}"

# Hub
HF_ENDPOINT = os.environ.get("HF_ENDPOINT", "https://huggingface.co")
HUB_DATASETS_URL = HF_ENDPOINT + "/datasets/{repo_id}/resolve/{revision}/{path}"
Expand Down
7 changes: 2 additions & 5 deletions src/datasets/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,10 @@ def head_hf_s3(identifier: str, filename: str, use_cdn=False, max_retries=0) ->
)


def hf_github_url(path: str, name: str, dataset=True, revision: Optional[str] = None) -> str:
def hf_github_url(path: str, name: str, revision: Optional[str] = None) -> str:
default_revision = "main" if version.parse(__version__).is_devrelease else __version__
revision = revision or default_revision
if dataset:
return config.REPO_DATASETS_URL.format(revision=revision, path=path, name=name)
else:
return config.REPO_METRICS_URL.format(revision=revision, path=path, name=name)
return config.REPO_DATASETS_URL.format(revision=revision, path=path, name=name)


def url_or_path_join(base_name: str, *pathnames: str) -> str:
Expand Down

0 comments on commit 3e76736

Please sign in to comment.