# Pushing model to hub

**URL:** <https://discuss.huggingface.co/t/pushing-model-to-hub/34048>\
**Category:** 🤗Hub\
**Created:** [March 17, 2023, 4:29pm UTC](https://discuss.huggingface.co/t/pushing-model-to-hub/34048 "2023-03-17T16:29:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlhitawiMohammed22](https://avatars.discourse-cdn.com/v4/letter/a/b5a626/32.png) [@AlhitawiMohammed22](https://discuss.huggingface.co/u/AlhitawiMohammed22)\
**Post date:** [March 17, 2023, 4:29pm UTC](https://discuss.huggingface.co/t/pushing-model-to-hub/34048/1 "2023-03-17T16:29:52Z")

</div>

Hello everyone ,  
I want to push my model aftr training to the hub but only can push tokenizer and processor and not model from trainer loop  
after login with hugginface cli

```auto
training_args = Seq2SeqTrainingArguments(
        num_train_epochs=1, 
        learning_rate=1e-3,
        predict_with_generate=True,
        evaluation_strategy="steps",
        per_device_train_batch_size=4,
        per_device_eval_batch_size=4,
        # overwrite_output_dir= True,
        fp16=True,
        push_to_hub= True,
        output_dir="/home/1/test/testmodel",
        # push_to_hub_model_id="ft_trocr_test",
        # push_to_hub_token="",
        report_to=["tensorboard"],
        logging_steps=10,
        save_steps=50,
        eval_steps=50,
        save_total_limit=1,
        gradient_checkpointing=True,
    )

    # instantiate trainer
    trainer = Seq2SeqTrainer(
        model=model,
        tokenizer=processor.feature_extractor,
        args=training_args,
        compute_metrics=compute_metrics,
        train_dataset=train_dataset,
        eval_dataset=eval_dataset,
        data_collator=default_data_collator,
    )
    time.sleep(3)
    processor.tokenizer.push_to_hub("ft_trocr_test")

    time.sleep(3)
    processor.push_to_hub("ft_trocr_test")

    trainer.train()
    trainer.push_to_hub('ft_trocr_test') 
# processor.tokenizer.push_to_hub(
    # MODEL_SAVE_REPO= "ft_trocr_test",
    # use_temp_dir=True,
    # use_auth_token="")

```

the issue I face :

```auto
  main()
  File "train.py", line 157, in main
    trainer = Seq2SeqTrainer(
  File "/home/user/venv/lib/python3.8/site-packages/transformers/trainer.py", line 502, in __init__
    self.init_git_repo(at_init=True)
  File "/home/user/venv/lib/python3.8/site-packages/transformers/trainer.py", line 3275, in init_git_repo
    self.repo = Repository(
  File "/home/user/venv/lib/python3.8/site-packages/huggingface_hub/utils/_validators.py", line 124, in _inner_fn
    return fn(*args, **kwargs)
TypeError: __init__ () got an unexpected keyword argument 'private'

```

the model I am trying to train : [microsoft/trocr-small-handwritten · Hugging Face](https://huggingface.co/microsoft/trocr-small-handwritten)  
transformers vertion : 4.22.2
