When I use the following code as mentioned in the tutorial:
CODE:
import torch
from PIL import Image
from pyramid_dit import PyramidDiTForVideoGeneration
from diffusers.utils import load_image, export_to_video
torch.cuda.set_device(0)
model_dtype, torch_dtype = 'bf16', torch.bfloat16 # Use bf16, fp16 or fp32
model = PyramidDiTForVideoGeneration(
'PATH', # The downloaded checkpoint dir
model_dtype,
model_variant='diffusion_transformer_768p', # 'diffusion_transformer_384p'
)
/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py in load_config(cls, pretrained_model_name_or_path, return_unused_kwargs, return_commit_hash, **kwargs)
392 )
393 except RepositoryNotFoundError:
--> 394 raise EnvironmentError(
395 f"{pretrained_model_name_or_path} is not a local folder and is not a valid model identifier"
396 " listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a"
OSError: PATH/diffusion_transformer_768p is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo with token or log in with huggingface-cli login.
ENVIRONMENT DETAILS:
I am using Google Colab with TPU attached. Also the huggingface token is present in the secrets.
Thanks for your interest in our work. Please modify PATH by replacing it with the local directory where the model checkpoint is downloaded. Hope to hear from you soon.
When I use the following code as mentioned in the tutorial:
CODE: import torch from PIL import Image from pyramid_dit import PyramidDiTForVideoGeneration from diffusers.utils import load_image, export_to_video
torch.cuda.set_device(0) model_dtype, torch_dtype = 'bf16', torch.bfloat16 # Use bf16, fp16 or fp32
model = PyramidDiTForVideoGeneration( 'PATH', # The downloaded checkpoint dir model_dtype, model_variant='diffusion_transformer_768p', # 'diffusion_transformer_384p' )
model.vae.to("cuda") model.dit.to("cuda") model.text_encoder.to("cuda") model.vae.enable_tiling()
I get the following error ERROR: using half precision
HTTPError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name) 303 try: --> 304 response.raise_for_status() 305 except HTTPError as e:
18 frames /usr/local/lib/python3.10/dist-packages/requests/models.py in raise_for_status(self) 1023 if http_error_msg: -> 1024 raise HTTPError(http_error_msg, response=self) 1025
HTTPError: 401 Client Error: Unauthorized for url: https://huggingface.co/PATH/diffusion_transformer_768p/resolve/main/config.json
The above exception was the direct cause of the following exception:
RepositoryNotFoundError Traceback (most recent call last) /usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py in load_config(cls, pretrained_model_name_or_path, return_unused_kwargs, return_commit_hash, **kwargs) 378 # Load from URL or cache if already cached --> 379 config_file = hf_hub_download( 380 pretrained_model_name_or_path,
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_deprecation.py in inner_f(*args, *kwargs) 100 warnings.warn(message, FutureWarning) --> 101 return f(args, **kwargs) 102
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, *kwargs) 113 --> 114 return fn(args, **kwargs) 115
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in hf_hub_download(repo_id, filename, subfolder, repo_type, revision, library_name, library_version, cache_dir, local_dir, user_agent, force_download, proxies, etag_timeout, token, local_files_only, headers, endpoint, legacy_cache_layout, resume_download, force_filename, local_dir_use_symlinks) 1239 else: -> 1240 return _hf_hub_download_to_cache_dir( 1241 # Destination
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in _hf_hub_download_to_cache_dir(cache_dir, repo_id, filename, repo_type, revision, endpoint, etag_timeout, headers, proxies, token, local_files_only, force_download) 1346 # Otherwise, raise appropriate error -> 1347 _raise_on_head_call_error(head_call_error, force_download, local_files_only) 1348
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in _raise_on_head_call_error(head_call_error, force_download, local_files_only) 1854 # Repo not found or gated => let's raise the actual error -> 1855 raise head_call_error 1856 else:
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in _get_metadata_or_catch_error(repo_id, filename, repo_type, revision, endpoint, proxies, etag_timeout, headers, token, local_files_only, relative_filename, storage_folder) 1751 try: -> 1752 metadata = get_hf_file_metadata( 1753 url=url, proxies=proxies, timeout=etag_timeout, headers=headers, token=token
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, *kwargs) 113 --> 114 return fn(args, **kwargs) 115
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in get_hf_file_metadata(url, token, proxies, timeout, library_name, library_version, user_agent, headers) 1673 # Retrieve metadata -> 1674 r = _request_wrapper( 1675 method="HEAD",
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in _request_wrapper(method, url, follow_relative_redirects, **params) 375 if follow_relative_redirects: --> 376 response = _request_wrapper( 377 method=method,
/usr/local/lib/python3.10/dist-packages/huggingface_hub/file_download.py in _request_wrapper(method, url, follow_relative_redirects, params) 399 response = get_session().request(method=method, url=url, params) --> 400 hf_raise_for_status(response) 401 return response
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_errors.py in hf_raise_for_status(response, endpoint_name) 351 ) --> 352 raise RepositoryNotFoundError(message, response) from e 353
RepositoryNotFoundError: 401 Client Error. (Request ID: Root=1-6707a233-5c59c58014c2331a529e97c0;d1bca795-f732-483b-ac02-fa7fe3f7c8a5)
Repository Not Found for url: https://huggingface.co/PATH/diffusion_transformer_768p/resolve/main/config.json. Please make sure you specified the correct
repo_id
andrepo_type
. If you are trying to access a private or gated repo, make sure you are authenticated. Invalid username or password.During handling of the above exception, another exception occurred:
OSError Traceback (most recent call last) in <cell line: 9>()
7 model_dtype, torch_dtype = 'bf16', torch.bfloat16 # Use bf16, fp16 or fp32
8
----> 9 model = PyramidDiTForVideoGeneration(
10 'PATH', # The downloaded checkpoint dir
11 model_dtype,
/content/Pyramid-Flow/pyramid_dit/pyramid_dit_for_video_gen_pipeline.py in init(self, model_path, model_dtype, use_gradient_checkpointing, return_log, model_variant, timestep_shift, stage_range, sample_ratios, scheduler_gamma, use_mixed_training, use_flash_attn, load_text_encoder, load_vae, max_temporal_length, frame_per_unit, use_temporal_causal, corrupt_ratio, interp_condition_pos, stages, **kwargs) 87 else: 88 print("using half precision") ---> 89 self.dit = PyramidDiffusionMMDiT.from_pretrained( 90 dit_path, torch_dtype=torch_dtype, 91 use_gradient_checkpointing=use_gradient_checkpointing,
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, *kwargs) 112 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.name, has_token=has_token, kwargs=kwargs) 113 --> 114 return fn(args, **kwargs) 115 116 return _inner_fn # type: ignore
/usr/local/lib/python3.10/dist-packages/diffusers/models/modeling_utils.py in from_pretrained(cls, pretrained_model_name_or_path, **kwargs) 610 611 # load config --> 612 config, unused_kwargs, commit_hash = cls.load_config( 613 config_path, 614 cache_dir=cache_dir,
/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_validators.py in _inner_fn(*args, *kwargs) 112 kwargs = smoothly_deprecate_use_auth_token(fn_name=fn.name, has_token=has_token, kwargs=kwargs) 113 --> 114 return fn(args, **kwargs) 115 116 return _inner_fn # type: ignore
/usr/local/lib/python3.10/dist-packages/diffusers/configuration_utils.py in load_config(cls, pretrained_model_name_or_path, return_unused_kwargs, return_commit_hash, **kwargs) 392 ) 393 except RepositoryNotFoundError: --> 394 raise EnvironmentError( 395 f"{pretrained_model_name_or_path} is not a local folder and is not a valid model identifier" 396 " listed on 'https://huggingface.co/models'\nIf this is a private repository, make sure to pass a"
OSError: PATH/diffusion_transformer_768p is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models' If this is a private repository, make sure to pass a token having permission to this repo with
token
or log in withhuggingface-cli login
.ENVIRONMENT DETAILS: I am using Google Colab with TPU attached. Also the huggingface token is present in the secrets.