MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / populate_model_card

Function populate_model_card

diffusers/src/diffusers/utils/hub_utils.py:169–182  ·  view source on GitHub ↗

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

(model_card: ModelCard, tags: Union[str, List[str]] = None)

Source from the content-addressed store, hash-verified

167
168
169def populate_model_card(model_card: ModelCard, tags: Union[str, List[str]] = None) -> ModelCard:
170 """Populates the `model_card` with library name and optional tags."""
171 if model_card.data.library_name is None:
172 model_card.data.library_name = "diffusers"
173
174 if tags is not None:
175 if isinstance(tags, str):
176 tags = [tags]
177 if model_card.data.tags is None:
178 model_card.data.tags = []
179 for tag in tags:
180 model_card.data.tags.append(tag)
181
182 return model_card
183
184
185def extract_commit_hash(resolved_file: Optional[str], commit_hash: Optional[str] = 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