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

TypeError: unsupported operand type(s) for /: 'str' and 'str' at trained_model = finbert.train(train_examples = train_data, model = model) #29

Closed
nithinreddyy opened this issue Oct 8, 2020 · 3 comments

Comments

@nithinreddyy
Copy link

I'm facing an issue at code

trained_model = finbert.train(train_examples = train_data, model = model)

Error is

TypeError                                 Traceback (most recent call last)
<ipython-input-11-2ebf0cb3d4e8> in <module>
----> 1 trained_model = finbert.train(train_examples = train_data, model = model)

~\finBERT-master\finbert\finbert.py in train(self, train_examples, model)
    482                     print('No best model found')
    483                 torch.save({'epoch': str(i), 'state_dict': model.state_dict()},
--> 484                            self.config.model_dir / ('temporary' + str(i)))
    485                 best_model = i
    486 

TypeError: unsupported operand type(s) for /: 'str' and 'str'
@doguaraci
Copy link
Member

self.config.model_dir should have PosixPath class. Could you please check if that is the case?

@luke4u
Copy link

luke4u commented Mar 15, 2022

Hi @doguaraci @nithinreddyy , just checking if this is resolved properly? I am facing the same issue!

Thank you!

@luke4u
Copy link

luke4u commented Mar 15, 2022

for anyone who is interested, try this:
cl_path = pathlib.Path(project_dir)/'resources'/'models'/'classifier_model'/'finbert-sentiment'

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