# How to load my own pretrained model to huggingface code

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-my-own-pretrained-model-to-huggingface-code%2F29425%3E%5C
**Category:** Intermediate\
**Created:** [January 12, 2023, 8:10am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-my-own-pretrained-model-to-huggingface-code%2F29425 "2023-01-12T08:10:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![moransh](https://avatars.discourse-cdn.com/v4/letter/m/d78d45/32.png) [@moransh](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmoransh)%5C
**Post date:** [January 12, 2023, 8:10am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-my-own-pretrained-model-to-huggingface-code%2F29425%2F1 "2023-01-12T08:10:29Z")

</div>

hello

i trained a bert-large model using my own code and I saved my model in a .pt format.  
now I want to use it for FT QA SQUAD training task.  
a.k.a: load my model using AutoModelForQuestionAnswering.from\_pretrained(…) method

I don’t know how to do this since from\_pretrained() method asks for a .json file  
can someone help me?

Thank you

---

<div class="post-metadata">

**Author:** ![BerkanDogan](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/berkandogan/32/13890_2.png) [@BerkanDogan](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FBerkanDogan)%5C
**Post date:** [January 31, 2023, 9:06am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fhow-to-load-my-own-pretrained-model-to-huggingface-code%2F29425%2F2 "2023-01-31T09:06:47Z")

</div>

> **[Sharing custom models](https://huggingface.co/docs/transformers/custom_models)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

You can look at this
