MCPcopy
hub / github.com/huggingface/diffusers / populate_model_card

Function populate_model_card

src/diffusers/utils/hub_utils.py:188–201  ·  view source on GitHub ↗

Populates the `model_card` with library name and optional tags.

(model_card: ModelCard, tags: str | list[str] | None = None)

Source from the content-addressed store, hash-verified

186
187
188def populate_model_card(model_card: ModelCard, tags: str | list[str] | None = None) -> ModelCard:
189 """Populates the `model_card` with library name and optional tags."""
190 if model_card.data.library_name is None:
191 model_card.data.library_name = "diffusers"
192
193 if tags is not None:
194 if isinstance(tags, str):
195 tags = [tags]
196 if model_card.data.tags is None:
197 model_card.data.tags = []
198 for tag in tags:
199 model_card.data.tags.append(tag)
200
201 return model_card
202
203
204def extract_commit_hash(resolved_file: str | None, commit_hash: str | None = None):

Callers 15

save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90
save_model_cardFunction · 0.90

Calls

no outgoing calls

Used in the wild real call sites across dependent graphs

searching dependent graphs…