1
0
mirror of https://github.com/huggingface/diffusers.git synced 2026-01-27 17:22:53 +03:00

Flax: Ignore PyTorch, ONNX files when they coexist with Flax weights (#5237)

Ignore PyTorch, ONNX files when they coexist with Flax weights
This commit is contained in:
Pedro Cuenca
2023-10-02 12:17:23 +02:00
committed by GitHub
parent 84e5cc596c
commit 0c7cb9a613

View File

@@ -341,8 +341,8 @@ class FlaxDiffusionPipeline(ConfigMixin, PushToHubMixin):
allow_patterns = [os.path.join(k, "*") for k in folder_names]
allow_patterns += [FLAX_WEIGHTS_NAME, SCHEDULER_CONFIG_NAME, CONFIG_NAME, cls.config_name]
# make sure we don't download PyTorch weights, unless when using from_pt
ignore_patterns = "*.bin" if not from_pt else []
ignore_patterns = ["*.bin", "*.safetensors"] if not from_pt else []
ignore_patterns += ["*.onnx", "*.onnx_data", "*.xml", "*.pb"]
if cls != FlaxDiffusionPipeline:
requested_pipeline_class = cls.__name__