title: When Creating Bert Model Tokenizer for Txt file receive this error
body: <p>'''#@title Installing the Hugging Face PyTorch Interface for Bert</p>
  <h1>!pip install pytorch-pretrained-bert pytorch-nlp</h1>
  <p>!pip install -q transformers
  from transformers import BertTokenizerFast</p>
  <p>tokenizer = BertTokenizerFast.from_pretrained(&quot;bert-base-multilingual-cased&quot;)
  from transformers import BertForMaskedLM</p>
  <p>model = BertForMaskedLM.from_pretrained(&quot;bert-base-multilingual-cased&quot;)</p>
  <p>print(&quot;Number of parameters in mBERT model:&quot;)</p>
  <p>print(model.num_parameters())
  from transformers import Trainer
  trainer = Trainer(</p>
  <pre><code>model=model,
  
  args=training_args,
  
  data_collator=data_collator,
  
  train_dataset=dataset)
  </code></pre>
  <p>import time</p>
  <p>start = time.time()</p>
  <p>trainer.train()</p>
  <p>end = time.time()</p>
  <p>print(&quot;Number of seconds for training:&quot;)</p>
  <p>print((end-start))
  trainer.save_model(&quot;kazmbert&quot;)
  from transformers import pipeline</p>
  <p>fill_mask = pipeline(</p>
  <pre><code>&quot;fill-mask&quot;,
  
  model=&quot;kazmbert&quot;,
  
  tokenizer=tokenizer)
  </code></pre>
  <p>from tokenizers import BertWordPieceTokenizer
  import os</p>
  <p>paths = [&quot;almatytv.txt&quot;]</p>
  <p>tokenizer = BertWordPieceTokenizer()</p>
  <p>tokenizer.train(</p>
  <pre><code>paths,
  
  vocab_size=10000,
  
  min_frequency=2,
  
  show_progress=True,
  
  special_tokens=[&quot;[PAD]&quot;, &quot;[UNK]&quot;, &quot;[CLS]&quot;, &quot;[SEP]&quot;, &quot;[MASK]&quot;],   
  
  limit_alphabet=1000,
  
  wordpieces_prefix=&quot;##&quot;)
  </code></pre>
  <p>!mkdir kazmbert</p>
  <h2>tokenizer.save(&quot;kazmbert&quot;)'''</h2>
  <p>Exception                                 Traceback (most recent call last)
   in ()
  34
  35
  ---&gt; 36 tokenizer.save(&quot;kazmbert&quot;)</p>
  <p>/usr/local/lib/python3.7/dist-packages/tokenizers/implementations/base_tokenizer.py in save(self, path, pretty)
  334                 A path to the destination Tokenizer file
  335         &quot;&quot;&quot;
  --&gt; 336         return self._tokenizer.save(path, pretty)
  337
  338     def to_str(self, pretty: bool = False):</p>
  <p>Exception: Is a directory (os error 21)</p>