# Tokenizer文件缺失报错TypeError:\_\_init\_\(\) missing 2 required positional arguments: 'vocab\_file' and 'merge\_file'

**1. 系统环境**

硬件环境\(Ascend/GPU/CPU\): Ascend

软件环境: MindSpore 版本: 2.2

执行模式： 不限

**2. 报错信息**

2.1 问题描述

加载WizardCoderTokenizer.from\_pretrained\(…\)时出现报错，发现缺少两个文件vocab\_file和merge\_file。

```
Traceback (most recent call last):   File /home/wizardcoder/1_wizardcoder-mindformers/mindformers/tools/register/register.py" , line 217, in get_instance return obi cls(**kwaras)
TypeError:__init_() missing 2 required positional arguments: 'vocab_file' and 'merge_file'
```

**3. 根因分析**

在tokenizer\_config.json文件新增两列，指定这两个文件路径

**4. 解决方案**

需在tokenizer\_config.json文件中增加vocab\_file和merge\_file对应的文件路径。

```
"bos_token": "<lendoftext|>",
"clean_up_tokenization_spaces": true,
"eos token": "＜lendoftext|>",
"model_max_length": 2048,
"padding_side": "right",
"tokenizer_class": "WizardCoderTokenizer",
"unk_token": "<lendoftext|>",
"vocab size": 49152,
"vocab_file": "/xxxxxx/wizardcoder/vocab.json",
"merge_file":  '/xxxxxx/wizardcoder/merges.txt
```

