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

Add staticmethod decorator #1257

Merged
merged 3 commits into from
Nov 28, 2019
Merged

Conversation

yahshibu
Copy link
Contributor

Hello,
I suspect that it is better to attach the staticmethod decorator to some methods.
If you like it, please merge this into master.
Thank you.

@yahshibu
Copy link
Contributor Author

yahshibu commented Nov 1, 2019

I believe that the test by travis-ci was stopped at the place not related to my modifications.
An error occurred on test_transformer_embeddings.py, but I didn't change any about embeddings.

Could you check the following three points?

  1. the fact that my modifications are independent of this failure of the test
  2. whether the test by travis-ci properly works now
  3. whether my modifications are acceptable

Thank you.

@alanakbik
Copy link
Collaborator

@yahshibu thanks for adding this and please excuse the delay in checking the PR! The error was somewhere else and is now fixed so the PR is green!

flair/nn.py Outdated
@@ -68,13 +70,13 @@ def save(self, model_file: Union[str, Path]):
torch.save(model_state, str(model_file), pickle_protocol=4)

@classmethod
def load(cls, model: Union[str, Path]):
def load(cls, model_file: Union[str, Path]):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yahshibu The load() method is also used to load a pre-trained tagger by passing a string, as in SequenceTagger.load('ner'). In this case, the string is not a model file, so I think the original variable name model might be better here.

@yahshibu
Copy link
Contributor Author

@alanakbik Thank you for your help! I changed the argument's name back to the original one. It passed the tests by travis-ci. Thanks!

@alanakbik
Copy link
Collaborator

@yahshibu Thanks!

@alanakbik
Copy link
Collaborator

👍

1 similar comment
@yosipk
Copy link
Collaborator

yosipk commented Nov 28, 2019

👍

@yosipk yosipk merged commit 1d44abf into flairNLP:master Nov 28, 2019
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

Successfully merging this pull request may close these issues.

3 participants