-
Notifications
You must be signed in to change notification settings - Fork 31.6k
Closed
Labels
Description
System Info
transformersversion: 4.46.3- Platform: Linux-5.15.0-125-generic-x86_64-with-glibc2.35
- Python version: 3.11.10
- Huggingface_hub version: 0.26.3
- Safetensors version: 0.4.5
- Accelerate version: 1.1.0
- Accelerate config: not found
- PyTorch version (GPU?): 2.5.1 (True)
- Tensorflow version (GPU?): not installed (NA)
- Flax version (CPU?/GPU?/TPU?): not installed (NA)
- Jax version: not installed
- JaxLib version: not installed
- Using distributed or parallel set-up in script?:
- Using GPU in script?:
- GPU type: NVIDIA H100 80GB HBM3
Who can help?
Information
- The official example scripts
- My own modified scripts
Tasks
- An officially supported task in the
examplesfolder (such as GLUE/SQuAD, ...) - My own task or dataset (give details below)
Reproduction
Call trainer.create_model_card(..., datasets=[]).
The checks at
transformers/src/transformers/modelcard.py
Lines 492 to 502 in de8a0b7
| if self.dataset is None: | |
| model_card += "an unknown dataset." | |
| else: | |
| if isinstance(self.dataset, str): | |
| model_card += f"the {self.dataset} dataset." | |
| elif isinstance(self.dataset, (tuple, list)) and len(self.dataset) == 1: | |
| model_card += f"the {self.dataset[0]} dataset." | |
| else: | |
| model_card += ( | |
| ", ".join([f"the {ds}" for ds in self.dataset[:-1]]) + f" and the {self.dataset[-1]} datasets." | |
| ) |
else branch and access datasets[-1].
Expected behavior
No exception should be raised, no dataset info should be included in the model card.