# Reducing output size when performing hyperparameter search

**URL:** <https://discuss.huggingface.co/t/reducing-output-size-when-performing-hyperparameter-search/6701>\
**Category:** Beginners\
**Created:** [June 10, 2021, 2:33pm UTC](https://discuss.huggingface.co/t/reducing-output-size-when-performing-hyperparameter-search/6701 "2021-06-10T14:33:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![navjordj](https://avatars.discourse-cdn.com/v4/letter/n/eb9ed0/32.png) [@navjordj](https://discuss.huggingface.co/u/navjordj)\
**Post date:** [June 10, 2021, 2:33pm UTC](https://discuss.huggingface.co/t/reducing-output-size-when-performing-hyperparameter-search/6701/1 "2021-06-10T14:33:11Z")

</div>

Hello everyone!

I’ve been trying to perform a simple hyperparameter research on ‘distilroberta-base’. When using Kaggle notebooks there is a 20 GB limit on outputs. Even when i am doing only 5 trials the output directory fills up. I am used to using GridSearchCV for HP-search which only keeps track of the best parameters and retrains at the end without saving individual models during the search.

I have tried using ‘overwrite\_output\_dir=True’ in TrainingArguments but this doesn’t seem to reduce any output.

I apologize if this is documented somewhere in the documentation, but I have not been able to find it.

My code:

```auto
model_training_arguments = TrainingArguments(
    "./model_output",
    evaluation_strategy = "epoch",
    fp16=True,
    per_device_train_batch_size=batch_size,
    per_device_eval_batch_size=batch_size,
    num_train_epochs=4,
    seed=2,
    load_best_model_at_end=True,
    overwrite_output_dir=True
)

model_trainer = Trainer(
    model_init=model_init,
    args=model_training_arguments,
    train_dataset=train_dataset,
    eval_dataset=valid_dataset,
    tokenizer=tokenizer,
    compute_metrics=metrics,
)

model_trainer.hyperparameter_search(
    direction = "minimize",
    backend = "optuna",
    n_trials=5
    
)

```

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![theudster](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@theudster](https://discuss.huggingface.co/u/theudster)\
**Post date:** [June 17, 2021, 9:56am UTC](https://discuss.huggingface.co/t/reducing-output-size-when-performing-hyperparameter-search/6701/2 "2021-06-17T09:56:22Z")

</div>

Set

` load_best_model_at_end=False,`

and add

` save_strategy = 'no', # The checkpoint save strategy to adopt during training.`

On the training arguments
