in yourbench/utils/dataset_engine.py [0:0]
def upload_dataset_card(config: dict[str, Any]) -> None:
"""
Public interface to generate and upload a dataset card to Hugging Face Hub.
This function performs configuration checks (like upload_card setting and offline mode)
and then delegates to the internal _generate_and_upload_dataset_card() implementation.
It should be called at the end of the pipeline when all subsets are available.
Args:
config: Pipeline configuration dictionary containing 'hf_configuration'
with settings like 'upload_card' flag
"""
try:
# Check if card upload is enabled in config
hf_config = config.get("hf_configuration", {})
upload_card = hf_config.get("upload_card", True)
if not upload_card:
logger.info("Dataset card upload disabled in configuration. Skipping card upload.")
return
if _is_offline():
logger.info("Offline mode enabled. Skipping dataset card upload.")
return
logger.info("Uploading dataset card with complete pipeline information")
_generate_and_upload_dataset_card(config)
except Exception as e:
logger.error(f"Error uploading dataset card: {e}")