# Can someone help guide how to finetune DeBERTa V3 model?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-someone-help-guide-how-to-finetune-deberta-v3-model%2F80530%3E%5C
**Category:** Models\
**Created:** [April 7, 2024, 8:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-someone-help-guide-how-to-finetune-deberta-v3-model%2F80530 "2024-04-07T08:24:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![clasyc](https://avatars.discourse-cdn.com/v4/letter/c/ee7513/32.png) [@clasyc](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fclasyc)%5C
**Post date:** [April 7, 2024, 8:24am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-someone-help-guide-how-to-finetune-deberta-v3-model%2F80530%2F1 "2024-04-07T08:24:53Z")

</div>

I am interested in fine-tuning the following model: [mdeberta-v3-base-squad2 on Hugging Face](https://huggingface.co/timpal0l/mdeberta-v3-base-squad2).

As I am totally noob on this topic, I would greatly appreciate any guidance provided.

I attempted to follow the documentation available at [Custom Datasets for Question Answering with SQuAD 2.0 on Hugging Face](https://huggingface.co/transformers/v4.6.0/custom_datasets.html?highlight=squaddata#question-answering-with-squad-2-0), but encountered difficulties in loading the tokenizer. Below is the code snippet I used:

```python
from transformers import DebertaV2Tokenizer
import torch
from datasets import load_dataset
from torch.utils.data import Dataset

squad_v2 = load_dataset("squad_v2")
tokenizer = DebertaV2Tokenizer.from_pretrained('timpal0l/mdeberta-v3-base-squad2')

```

However, I encountered the following error, suggesting an issue with locating the vocabulary file:

```auto
  File "C:\<...>venv\lib\site-packages\transformers\models\deberta_v2\tokenization_deberta_v2.py", line 130, in __init__
    if not os.path.isfile(vocab_file):                                                                                                                                           
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.9_3.9.3568.0_x64__qbz5n2kfra8p0\lib\genericpath.py", line 30, in isfile                                   
    st = os.stat(path)                                                                                                                                                           
TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

```

I am unsure if this issue arises from attempting to use a DeBERTa V3 model with a DeBERTa V2 architecture. The repository’s configuration file mentions “DebertaV2ForQuestionAnswering,” leading me to believe it should be compatible. Could the problem be unrelated to the version discrepancy, or is there another potential issue at play?

---

<div class="post-metadata">

**Author:** ![Krillinkills](https://avatars.discourse-cdn.com/v4/letter/k/9e8a1a/32.png) [@Krillinkills](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2FKrillinkills)%5C
**Post date:** [August 25, 2024, 9:12am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Fcan-someone-help-guide-how-to-finetune-deberta-v3-model%2F80530%2F2 "2024-08-25T09:12:28Z")

</div>

you can try  
tokenizer = AutoTokenizer.from\_pretrained(‘timpal0l/mdeberta-v3-base-squad2’)  
this worked for me
