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

Hugging Face Hub Upgrades #4231

Merged
merged 10 commits into from
Apr 5, 2024
Next Next commit
makes fiftyone version req optional
  • Loading branch information
jacobmarks committed Apr 4, 2024
commit 6cab1d02bba970ffc4566df22820c82bf3b3233c
11 changes: 8 additions & 3 deletions fiftyone/utils/huggingface.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def push_to_hub(
private=False,
exist_ok=False,
dataset_type=None,
min_fiftyone_version=None,
label_field=None,
frame_labels_field=None,
token=None,
Expand All @@ -80,6 +81,7 @@ def push_to_hub(
private (True): whether the repo should be private
exist_ok (False): if True, do not raise an error if repo already exists.
dataset_type (None): the type of the dataset to create
min_fiftyone_version (None): the minimum version of FiftyOne required
label_field (None): controls the label field(s) to export. Only
applicable to labeled datasets. Can be any of the following:

Expand Down Expand Up @@ -135,6 +137,7 @@ def push_to_hub(
description=description,
license=license,
tags=tags,
min_fiftyone_version=min_fiftyone_version,
)

## Create the dataset repo
Expand Down Expand Up @@ -309,16 +312,18 @@ def _populate_config_file(
description=None,
license=None,
tags=None,
min_fiftyone_version=None,
):
config_dict = {
"name": dataset.name,
"format": dataset_type.__name__,
"fiftyone": {
"version": f">={foc.VERSION}",
},
"tags": tags,
}

if min_fiftyone_version is not None:
version_val = f">={min_fiftyone_version}"
config_dict["fiftyone"] = {"version": version_val}

if description is not None:
config_dict["description"] = description

Expand Down