# Run\_qa.py related query

**URL:** <https://discuss.huggingface.co/t/run-qa-py-related-query/28671>\
**Category:** Beginners\
**Created:** [December 31, 2022, 7:15am UTC](https://discuss.huggingface.co/t/run-qa-py-related-query/28671 "2022-12-31T07:15:07Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gokul427](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/gokul427/32/13281_2.png) [@gokul427](https://discuss.huggingface.co/u/gokul427)\
**Post date:** [December 31, 2022, 7:15am UTC](https://discuss.huggingface.co/t/run-qa-py-related-query/28671/1 "2022-12-31T07:15:07Z")

</div>

When we use run\_qa.py on bert-base using custom data, will it finetune all the layers(head and body/core) or fine tune only the last layer by freezing other layers?  
Can we add custom layers and finetune training using run\_qa.py, please provide examples.

script: [main/examples/pytorch/question-answering/run\_qa.py](https://github.com/huggingface/transformers/blob/main/examples/pytorch/question-answering/run_qa.py)

---

<div class="post-metadata">

**Author:** ![gokul427](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/gokul427/32/13281_2.png) [@gokul427](https://discuss.huggingface.co/u/gokul427)\
**Post date:** [January 5, 2023, 1:06am UTC](https://discuss.huggingface.co/t/run-qa-py-related-query/28671/2 "2023-01-05T01:06:38Z")

</div>

Reviving this thread, please provide answers.

---

<div class="post-metadata">

**Author:** ![gokul427](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/gokul427/32/13281_2.png) [@gokul427](https://discuss.huggingface.co/u/gokul427)\
**Post date:** [January 6, 2023, 1:00am UTC](https://discuss.huggingface.co/t/run-qa-py-related-query/28671/3 "2023-01-06T01:00:50Z")

</div>

Example command used:  
python run\_qa.py   
–model\_name\_or\_path bert-base-uncased   
–dataset\_name squad   
–do\_train   
–do\_eval   
–per\_device\_train\_batch\_size 12   
–learning\_rate 3e-5   
–num\_train\_epochs 2   
–max\_seq\_length 384   
–doc\_stride 128   
–output\_dir /tmp/debug\_squad/
