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

Function _add_variant

diffusers/src/diffusers/utils/hub_utils.py:271–277  ·  view source on GitHub ↗
(weights_name: str, variant: Optional[str] = None)

Source from the content-addressed store, hash-verified

269
270
271def _add_variant(weights_name: str, variant: Optional[str] = None) -> str:
272 if variant is not None:
273 splits = weights_name.split(".")
274 splits = splits[:-1] + [variant] + splits[-1:]
275 weights_name = ".".join(splits)
276
277 return weights_name
278
279
280@validate_hf_hub_args

Callers 6

_get_model_fileFunction · 0.85
save_pretrainedMethod · 0.85
from_pretrainedMethod · 0.85
_fetch_index_fileFunction · 0.85

Calls

no outgoing calls