Skip to content

Commit 2effe3f

Browse files
Wauplindavanstrien
andauthored
Document base_model in modelcard metadata (#1936)
* support base_model in modelcard metadata * Update src/huggingface_hub/repocard_data.py Co-authored-by: Daniel van Strien <davanstrien@users.noreply.github.com> --------- Co-authored-by: Daniel van Strien <davanstrien@users.noreply.github.com>
1 parent e063d80 commit 2effe3f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/huggingface_hub/repocard_data.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ class ModelCardData(CardData):
253253
tags (`List[str]`, *optional*):
254254
List of tags to add to your model that can be used when filtering on the Hugging
255255
Face Hub. Defaults to None.
256+
base_model (`str` or `List[str]`, *optional*):
257+
The identifier of the base model from which the model derives. This is applicable for example if your model is a
258+
fine-tune or adapter of an existing model. The value must be the ID of a model on the Hub (or a list of IDs
259+
if your model derives from multiple models). Defaults to None.
256260
datasets (`List[str]`, *optional*):
257261
List of datasets that were used to train this model. Should be a dataset ID
258262
found on https://hf.co/datasets. Defaults to None.
@@ -295,6 +299,7 @@ def __init__(
295299
license: Optional[str] = None,
296300
library_name: Optional[str] = None,
297301
tags: Optional[List[str]] = None,
302+
base_model: Optional[Union[str, List[str]]] = None,
298303
datasets: Optional[List[str]] = None,
299304
metrics: Optional[List[str]] = None,
300305
eval_results: Optional[List[EvalResult]] = None,
@@ -306,6 +311,7 @@ def __init__(
306311
self.license = license
307312
self.library_name = library_name
308313
self.tags = tags
314+
self.base_model = base_model
309315
self.datasets = datasets
310316
self.metrics = metrics
311317
self.eval_results = eval_results

0 commit comments

Comments
 (0)