Commit ·
369daec
1
Parent(s): 983d012
finish
Browse filesFiles changed (3)
166 unmodified lines167168169170171172173174166 unmodified linesdef convert(api: "HfApi", model_id: str, force: bool = False) -> Optional["CommitInfo"]:pr_title = "Adding `safetensors` variant of this model"info = api.model_info(model_id)filenames = set(s.rfilename for s in info.siblings if len(s.rfilename.split("/")) > 1)with TemporaryDirectory() as d:folder = os.path.join(d, repo_folder_name(repo_id=model_id, repo_type="models"))os.makedirs(folder)166 unmodified lines167168169170171172173174175176177178166 unmodified linesdef convert(api: "HfApi", model_id: str, force: bool = False) -> Optional["CommitInfo"]:pr_title = "Adding `safetensors` variant of this model"info = api.model_info(model_id)def is_valid_filename(filename):return len(filename.split("/")) > 1 or filename in ["pytorch_model.bin", "diffusion_pytorch_model.bin"]filenames = set(s.rfilename for s in info.siblings if is_valid_filename(s.rfilename))print(filenames)with TemporaryDirectory() as d:folder = os.path.join(d, repo_folder_name(repo_id=model_id, repo_type="models"))os.makedirs(folder)
__pycache__/app.cpython-310.pycAdded
__pycache__/convert.cpython-310.pycAdded
convert.py+5-1