# Transformers BERT QA Task: run\_qa.py vs run\_qa\_no\_trainer.py

**URL:** <https://discuss.huggingface.co/t/transformers-bert-qa-task-run-qa-py-vs-run-qa-no-trainer-py/11588>\
**Category:** 🤗Transformers\
**Created:** [November 11, 2021, 1:44am UTC](https://discuss.huggingface.co/t/transformers-bert-qa-task-run-qa-py-vs-run-qa-no-trainer-py/11588 "2021-11-11T01:44:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jinawei](https://avatars.discourse-cdn.com/v4/letter/j/a9a28c/32.png) [@Jinawei](https://discuss.huggingface.co/u/Jinawei)\
**Post date:** [November 11, 2021, 1:44am UTC](https://discuss.huggingface.co/t/transformers-bert-qa-task-run-qa-py-vs-run-qa-no-trainer-py/11588/1 "2021-11-11T01:44:28Z")

</div>

I am going to use transformers to prune a BERT model for downstream task squadv1.1. And there are two scripts in the examples of transformers. (run\_qa.py and run\_qa\_no\_trainer.py)

Because I have to add some additional code to the training process, I choose the script without the trainer API.

However, I can’t reproduce the squadv1 result with this script. Can anyone provide a suite of hyperparameters that can help me to train a BERT model with run\_qa\_no\_trainer.py that can generate an f1 score of 88 in the Squad v.1 task?

(I have 4 super 2020 Ti GPU)

Or is there any optimization for run\_qa.py? should I transfer to run\_qa.py?

Thank you very much.
