Skip to content

Commit

Permalink
dev(narugo): code save, ci skip
Browse files Browse the repository at this point in the history
  • Loading branch information
narugo1992 committed May 14, 2024
1 parent 0671347 commit 8d90e3c
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions zoo/wd14/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,23 +120,27 @@ def _is_fc(name):
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)
Expand Down

0 comments on commit 8d90e3c

Please sign in to comment.