# Fine-tuning a model on a token classification task

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-a-model-on-a-token-classification-task%2F18019%3E%5C
**Category:** Beginners\
**Created:** [May 16, 2022, 7:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-a-model-on-a-token-classification-task%2F18019 "2022-05-16T19:38:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tbosse](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tbosse/32/4796_2.png) [@tbosse](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftbosse)%5C
**Post date:** [May 16, 2022, 7:38pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-a-model-on-a-token-classification-task%2F18019%2F1 "2022-05-16T19:38:00Z")

</div>

When training my Token-Classification model i get this error:

HTTPError: 400 Client Error: Bad Request for url: [https://huggingface.co/api/repos/create](https://huggingface.co/api/repos/create) - Only regular characters and ‘-’, ‘\_’, ‘.’ are accepted. ‘–’ and ‘…’ are forbidden. ‘-’ and ‘.’ cannot start or end the name. The name cannot end with “.git”. Max length is 96.

I use the Notebook for Token-Classification on: _model\_checkpoint = “tbosse/bert-base-german-cased-finetuned-subj\_preTrained\_with\_noisyData”_

The error happens when trying to pass everything to a Trainer:

```auto
trainer = Trainer(
    model,
    args,
    train_dataset=tokenized_datasets["train"],
    eval_dataset=tokenized_datasets["validation"],
    data_collator=data_collator,
    tokenizer=tokenizer,
    compute_metrics=compute_metrics
)

```

```auto
---------------------------------------------------------------------------
HTTPError Traceback (most recent call last)
<ipython-input-55-d8301846d702> in <module>()
      6 data_collator=data_collator,
      7 tokenizer=tokenizer,
----> 8 compute_metrics=compute_metrics
      9 )

7 frames
/usr/local/lib/python3.7/dist-packages/requests/models.py in raise_for_status(self)
    939 
    940 if http_error_msg:
--> 941 raise HTTPError(http_error_msg, response=self)
    942 
    943 def close(self):

```

There seems to be a similar Topic:

[Fine-tune a model on translation: - Beginners - Hugging Face Forums](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tune-a-model-on-translation%2F8443%2F6)

I already tried removing the “/” from the model\_checkpoint, that only created different errors.

---

<div class="post-metadata">

**Author:** ![merve](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/merve/32/49809_2.png) [@merve](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmerve)%5C
**Post date:** [May 17, 2022, 12:22pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-a-model-on-a-token-classification-task%2F18019%2F2 "2022-05-17T12:22:07Z")

</div>

Welcome to Hugging Face Forum 🤗

I checked on Hub and saw you were able to create repository which was your problem. Was it solved?

---

<div class="post-metadata">

**Author:** ![tbosse](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tbosse/32/4796_2.png) [@tbosse](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftbosse)%5C
**Post date:** [May 17, 2022, 12:32pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-a-model-on-a-token-classification-task%2F18019%2F3 "2022-05-17T12:32:50Z")

</div>

No, i still have the same problem. Those repositories were created when changing the model\_checkpoint to “bert-base-german-cased”, to see if that seemed to be the problem.

---

<div class="post-metadata">

**Author:** ![tbosse](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/tbosse/32/4796_2.png) [@tbosse](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Ftbosse)%5C
**Post date:** [May 17, 2022, 4:26pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Ffine-tuning-a-model-on-a-token-classification-task%2F18019%2F4 "2022-05-17T16:26:10Z")

</div>

The issue is resolved. I changed the name in TrainingArguments to make sure there is no “/” in the name and now it works.
