Mark as not-for-all-audiences

#1
by lhoestq HF staff - opened

This dataset (and some others of yours I think) seems to have NSFW content, please add the Not for all audiences warning

image.png

DeepGHS CyberHarem org
edited Aug 21, 2023

@lhoestq Thank you for this notification. This repository is now marked as not-for-all-audiences.

But for other repositories (over one thousands), it takes a quite long time to mark them.

Is there any API for listing repositories of one organization? I cannot find this in huggingface_hub.

narugo changed pull request status to merged

You can use

from huggingface_hub import list_datasets

datasets = list(list_datasets(author="CyberHarem"))
DeepGHS CyberHarem org

You can use

from huggingface_hub import list_datasets

datasets = list(list_datasets(author="CyberHarem"))

Okay, thanks, this helps a lot.

However, due to the substantial amount of data yet to be processed, even with the use of scripts, it will take some time. We aim to complete the processing within a few weeks as quickly as possible.

Hi @narugo , here is a small script to add the tag programmatically - this way you can run it on all your datasets using a for loop

from huggingface_hub import DatasetCard
from huggingface_hub.utils import EntryNotFoundError


def add_nfaa(dataset: str) -> None:
    """
    Add the "not-for-all-audiences" tag to the dataset.
    More info at
    https://huggingface.co/content-guidelines
    https://huggingface.co/blog/ethics-soc-3
    """
    try:
        dataset_card = DatasetCard.load(dataset, repo_type="dataset")
    except EntryNotFoundError:
        dataset_card = DatasetCard(content=f"# Dataset card for {dataset}")
    tags = dataset_card.data.get("tags", [])
    tags.append("not-for-all-audiences")
    dataset_card.data["tags"] = tags
    dataset_card.push_to_hub(dataset, repo_type="dataset")


if __name__ == "__main__":
    add_nfaa("username/dataset_name")

Hey @narugo , without actions from your side to add the NFAA tag we'll have to disable the dataset viewer for all your datasets.

DeepGHS CyberHarem org
edited Sep 17, 2023

Hey, @lhoestq

Sorry for the delay; I had a busy schedule earlier. I've now commenced batch processing of the dataset. I anticipate it will be completed at approximately 2023-09-17 16:00:00 Eastern Time. Please restore viewer access to the dataset at that point.

Additionally, I suggest optimizing the mechanism for 'not-for-all-audiences'. Currently, it's quite inconvenient as nearly every page switch necessitates a fresh click to access. Ideally, based on general logic, a user should only need to enter once to view the same dataset (or model) continuously. Alternatively, a permission validity period could be set for a specific duration (several hours or days), allowing uninterrupted access within that timeframe.

update: It's ready now.

Thanks ! I'll restore the viewer

Also thanks for the feedback regarding the current mechanism, I'll share this with the team

There is a setting you can turn on to not have to click the NFAA button every time at https://huggingface.co/settings/content-preferences

DeepGHS CyberHarem org

There is a setting you can turn on to not have to click the NFAA button every time at https://huggingface.co/settings/content-preferences

Wow, thanks for the new feature! It is much better now.

Sign up or log in to comment