Cannot load .pt model using Transformers
Hi,

I want to use Transformers to load .pt model. How can I do that? I know how to load .bin using transformers, but I do not know how to load .pt model using transformers. Thanks.

    config = config_class.from_pretrained(
        args.config_name if args.config_name else args.model_name_or_path,
        num_labels=num_labels,
        finetuning_task=args.task_name,
        cache_dir=args.cache_dir if args.cache_dir else None,
    )
    tokenizer = tokenizer_class.from_pretrained(
        args.tokenizer_name if args.tokenizer_name else args.model_name_or_path,
        do_lower_case=args.do_lower_case,
        cache_dir=args.cache_dir if args.cache_dir else None,
    )
    model = model_class.from_pretrained(
        args.model_name_or_path,
        from_tf=bool(".ckpt" in args.model_name_or_path),
        config=config,
        cache_dir=args.cache_dir if args.cache_dir else None,
    )

What is your .pt model? Where did you obtain it from?<|||||>While we don't have the complete details following is a possible solution:
You can initialize your model using transformers and simply load the weights using
`model.load_state_dict(torch.load('model.pt'))`

In case this is not what you're looking for please add further details.<|||||>Hi @Ap1075, Thanks for your reply. It is working to load the `model.pt` if I define the `model` class, but do you know if I want to load the tokenizer from the `model.pt`. How can I do that? For example, I can load the tokenizer by this way from huggingface `tokenizer = AutoTokenizer.from_pretrained(pretrained_model, do_lower_case=True)`, but I cannot do that if the `pretrained_model='model.pt'`.<|||||>Also, for this command, `model.load_state_dict(torch.load('model.pt'))`, if what is the `model` from `model.load_state_dict()`? How to define the model here? <|||||>This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.