Fine-tune a model on translation:
when passing all along with datasets to theSeq2SeqTrainercallI got :HTTPError: 400 Client Error: Bad Request for url:https://huggingface.co/api/repos/create- Only regular characters and ‘-’, ‘_’, ‘.’ accepted
2021-07-17T08:07:32Z
You should post relevant code when asking for help, otherwise no one can really understand what’s going on. In this instance, the problem is very likely when your define yourSeq2SeqTrainingArguments, so please share how you defined those, or if you used your code as a script, what arguments you passed to it,
2021-07-17T09:17:58Z
Hi sgugger, Thanks for the advice, I just tried the same code fromHow to fine-tune a model on translationmodel = AutoModelForSeq2SeqLM.from_pretrained(model_checkpoint)

batch_size = 16

args = Seq2SeqTrainingArguments(

    "test-translation",

    evaluation_strategy = "epoch",

    learning_rate=2e-5,

    per_device_train_batch_size=batch_size,

    per_device_eval_batch_size=batch_size,

    weight_decay=0.01,

    save_total_limit=3,

    num_train_epochs=1,

    predict_with_generate=True,

    fp16=True,

    push_to_hub=True,

    push_to_hub_model_id=f"{model_checkpoint}-finetuned-{source_lang}-to-{target_lang}",

)
data_collator = DataCollatorForSeq2Seq(tokenizer, model=model)

trainer = Seq2SeqTrainer(

    model,

    args,

    train_dataset=tokenized_datasets["train"],

    eval_dataset=tokenized_datasets["validation"],

    data_collator=data_collator,

    tokenizer=tokenizer,

    compute_metrics=compute_metrics

)
2021-07-17T14:09:04Z
Once interpreted, what is the value off"{model_checkpoint}-finetuned-{source_lang}-to-{target_lang}"? Apparently since there is some special character in it according to the error message.
2021-07-17T15:19:07Z
The value is:Helsinki-NLP/opus-mt-en-ro-finetuned-en-to-ro
2021-07-17T15:25:29Z
Ah yes, the / is not going to work. You should remove it or replace it by a /. Will adapt the notebooks next week!
2021-07-17T15:29:05Z
Thanks a lot