Vamsi995 / Paraphrase-Generator

A paraphrase generator built using the T5 model which produces paraphrased English sentences.
MIT License
310 stars 66 forks source link

Cannot reproduce colab-notebook #21

Open j0st opened 3 years ago

j0st commented 3 years ago

Hi, I wanted to reproduce the Paraphrase.ipynb colab notebook but I get some errors in the fine-tuning section with PAWS-X dataset

checkpoint_callback = pl.callbacks.ModelCheckpoint(
    filepath=args.output_dir, prefix="checkpoint", monitor="val_loss", mode="min", save_top_k=5
)

train_params = dict(
    accumulate_grad_batches=args.gradient_accumulation_steps,
    gpus=args.n_gpu,
    max_epochs=args.num_train_epochs,
    early_stop_callback=False,
    precision= 16 if args.fp_16 else 32,
    amp_level=args.opt_level,
    gradient_clip_val=args.max_grad_norm,
    checkpoint_callback=checkpoint_callback,
    callbacks=[LoggingCallback()],
)

creates this error:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-17-213583cfc1cf> in <module>()
      1 checkpoint_callback = pl.callbacks.ModelCheckpoint(
----> 2     filepath=args.output_dir, prefix="checkpoint", monitor="val_loss", mode="min", save_top_k=5
      3 )
      4 
      5 train_params = dict(

TypeError: __init__() got an unexpected keyword argument 'filepath'

Any ideas? I just ran the notebook in google colab and didn't change any cells

Edit: managed to solve this by replacing "filepath" with "dirpath" and "prefix" with "filename" but then another error occured in the second the cell after that:

TypeError: __init__() got an unexpected keyword argument 'early_stop_callback'

Which probably still comes from the train_params or the checkpoint_callback.