Loading zoo/wd14/sync.py +12 −8 Original line number Diff line number Diff line Loading @@ -120,23 +120,27 @@ def sync(): assert tags_data.shape == (1, _get_model_tags_length(model_name)) assert embeddings.shape == (1, emb_width) if hf_fs.exists(f'datasets/deepghs/wd14_tagger_inversion/{model_name}/samples_200.npz'): _make_inverse( model_name=model_name, dst_dir=os.path.join(td, MODEL_NAMES[model_name]), onnx_model_file=onnx_file, scale=2000, ) invertible = True else: invertible = False records.append({ 'Name': model_name, 'Source Repository': f'[{MODEL_NAMES[model_name]}](https://huggingface.co/{MODEL_NAMES[model_name]})', 'Tags Count': _get_model_tags_length(model_name), 'Embedding Width': emb_width, 'Inverse Supported': 'Yes' if invertible else 'No', }) _get_model_file.cache_clear() _get_model_tags_length.cache_clear() if hf_fs.exists(f'datasets/deepghs/wd14_tagger_inversion/{model_name}/samples_200.npz'): _make_inverse( model_name=model_name, dst_dir=os.path.join(td, MODEL_NAMES[model_name]), onnx_model_file=onnx_file, scale=2000, ) df_records = pd.DataFrame(records) with open(os.path.join(td, 'README.md'), 'w') as f: print('---', file=f) Loading Loading
zoo/wd14/sync.py +12 −8 Original line number Diff line number Diff line Loading @@ -120,23 +120,27 @@ def sync(): assert tags_data.shape == (1, _get_model_tags_length(model_name)) assert embeddings.shape == (1, emb_width) if hf_fs.exists(f'datasets/deepghs/wd14_tagger_inversion/{model_name}/samples_200.npz'): _make_inverse( model_name=model_name, dst_dir=os.path.join(td, MODEL_NAMES[model_name]), onnx_model_file=onnx_file, scale=2000, ) invertible = True else: invertible = False records.append({ 'Name': model_name, 'Source Repository': f'[{MODEL_NAMES[model_name]}](https://huggingface.co/{MODEL_NAMES[model_name]})', 'Tags Count': _get_model_tags_length(model_name), 'Embedding Width': emb_width, 'Inverse Supported': 'Yes' if invertible else 'No', }) _get_model_file.cache_clear() _get_model_tags_length.cache_clear() if hf_fs.exists(f'datasets/deepghs/wd14_tagger_inversion/{model_name}/samples_200.npz'): _make_inverse( model_name=model_name, dst_dir=os.path.join(td, MODEL_NAMES[model_name]), onnx_model_file=onnx_file, scale=2000, ) df_records = pd.DataFrame(records) with open(os.path.join(td, 'README.md'), 'w') as f: print('---', file=f) Loading