Commit 8d90e3cc authored by narugo1992's avatar narugo1992
Browse files

dev(narugo): code save, ci skip

parent 06713470
Loading
Loading
Loading
Loading
+12 −8
Original line number Diff line number Diff line
@@ -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)