Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New TypeError: __init__() got an unexpected keyword argument 'progress_bar_refresh_rate' #84

Open
aishwaryapisal9 opened this issue Aug 16, 2022 · 2 comments

Comments

@aishwaryapisal9
Copy link

aishwaryapisal9 commented Aug 16, 2022

I have imported the model and necessary libraries. I am getting the below error in google colab. I have used this model earlier also few months back and it was working fine. This is the new issue I am facing recently with the same code.


TypeError: init() got an unexpected keyword argument 'progress_bar_refresh_rate'

Imported libraries:

!pip install keytotext --upgrade
!sudo apt-get install git-lfs

from keytotext import trainer

Training Model:

model = trainer()
model.from_pretrained(model_name="t5-small")
model.train(train_df=df_train_final, test_df=df_test, batch_size=3, max_epochs=5,use_gpu=True)
model.save_model()

Have attached error screenshot

  • OS: Windows
  • Browser Chrome
    Error
@saied71
Copy link

saied71 commented Sep 16, 2022

I did a workaround for this problem.
I first installed ket2text as you did then clone the main branch and deleted progress_bar_refresh_rate as mentioned here. you can see the fork I used here

after that, I import trainer directly from the module. In other words, I created a trainer.py at the root of my notebook and imported it.
So the code is :

import pandas as pd
from trainer import trainer
from transformers import  AutoModelForSeq2SeqLM

data = pd.read_csv("samples.csv")
df = data.copy()
df.rename({"sents":"text", "kws":"keywords"}, axis=1, inplace=True)

train_df = df[:200]
test_df = df[200:250]


model = trainer()
model.from_pretrained(model_name="t5-small")

model.train(train_df=train_df, test_df=test_df,use_gpu=True,batch_size=1, max_epochs=3)

@Mukish45
Copy link

I did a workaround for this problem. I first installed ket2text as you did then clone the main branch and deleted progress_bar_refresh_rate as mentioned here. you can see the fork I used here

after that, I import trainer directly from the module. In other words, I created a trainer.py at the root of my notebook and imported it. So the code is :

import pandas as pd
from trainer import trainer
from transformers import  AutoModelForSeq2SeqLM

data = pd.read_csv("samples.csv")
df = data.copy()
df.rename({"sents":"text", "kws":"keywords"}, axis=1, inplace=True)

train_df = df[:200]
test_df = df[200:250]


model = trainer()
model.from_pretrained(model_name="t5-small")

model.train(train_df=train_df, test_df=test_df,use_gpu=True,batch_size=1, max_epochs=3)

I am facing two issues.
One, I can't use the GPU to run this program.
Second, I'm facing issue in uploading the model. Can you able to upload and load the model?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants