Back to Blog
Git submodule reset7/25/2023 ![]() PyTorch model using the provided conversion scripts and loading the PyTorch model afterwards. This loading path is slower than converting the TensorFlow checkpoint in a This case, from_tf should be set to True and a configuration object should be provided asĬonfig argument. A path or url to a tensorflow index checkpoint file (e.g.A path to a directory containing model weights saved using.User or organization name, like dbmdz/bert-base-german-cased. Valid model ids can be located at the root-level, like bert-base-uncased, or namespaced under a A string, the model id of a pretrained model hosted inside a model repo on.pretrained_model_name_or_path ( str or os.PathLike, optional).Upload the model file to the □ Model Hub while synchronizing a local clone of the repo in Whether or not to convert the model weights in safetensors format for safer serialization. safe_serialization ( bool, optional, defaults to False).Whether or not to create a PR with the uploaded files or directly commit. create_pr ( bool, optional, defaults to False).If expressed as a string, needs to be digits followed Will then be each of size lower than this size. The maximum size for a checkpoint before being sharded. max_shard_size ( int or str, optional, defaults to "10GB").When running huggingface-cli login (stored in ~/.huggingface). The token to use as HTTP bearer authorization for remote files. use_auth_token ( bool or str, optional).Whether or not the repository created should be private. Will default to True if there is no directory named like repo_id, False otherwise. Whether or not to use a temporary directory to store the files saved before they are pushed to the Hub. The name of the repository you want to push your model to. Models, pixel_values for vision models and input_values for speech models). ![]() Main_input_name ( str) - The name of the principal input to the model (often input_ids for NLP Is_parallelizable ( bool) - A flag indicating whether this model supports model parallelization. path ( str) - A path to the TensorFlow checkpoint.īase_model_prefix ( str) - A string indicating the attribute associated to the base model in derivedĬlasses of the same architecture adding modules on top of the base model.config ( PreTrainedConfig) - An instance of the configuration associated to the model.model ( PreTrainedModel) - An instance of the model on which to load the TensorFlow checkpoint.Load_tf_weights ( Callable) - A python method for loading a TensorFlow checkpoint in a PyTorch model, prune heads in the self-attention heads.Ĭlass attributes (overridden by derived classes):Ĭonfig_class ( PretrainedConfig) - A subclass of PretrainedConfig to use as configuration class.PreTrainedModel takes care of storing the configuration of the models and handles methods for loading,ĭownloading and saving models as well as a few methods common to all models to:
0 Comments
Read More
Leave a Reply. |