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

A bug on elmo.py #8

Closed
Just4Uzi opened this issue Oct 13, 2018 · 5 comments
Closed

A bug on elmo.py #8

Just4Uzi opened this issue Oct 13, 2018 · 5 comments

Comments

@Just4Uzi
Copy link

HI, i try to train a elmo model by runing python src/train.py -h ,but i got a SyntaxError: invalid syntax
in elmo.py, line 134

@Oneplus
Copy link
Member

Oneplus commented Oct 13, 2018

You will need python 3.6 to run the training script. Please check.

@Just4Uzi
Copy link
Author

i try to use python 3.6 to run script, but bug still exist.

hidden_states:List[Optional[Tuple[torch.Tensor,
torch.Tensor]]] = [None] * len(self.forward_layers)
SyntaxError: invalid syntax

also i am a little confused about the colon in " hidden_states:List ", what does this mean?

thanks

@Oneplus
Copy link
Member

Oneplus commented Oct 14, 2018

I am sorry but I cannot reproduce the error.
image

I believe colon in "hidden_states:List" is PEP 526: Syntax for variable annotations introduced in Python 3.6. See https://docs.python.org/3/whatsnew/3.6.html. By the way, we adopt this code from AllenNLP, and I believe it was well-tested. So, please double check your python version.

@Oneplus
Copy link
Member

Oneplus commented Oct 19, 2018

according to #11 it seems you've successfully run the test script. so i will close this issue.

@Oneplus Oneplus closed this as completed Oct 19, 2018
@nda1992
Copy link

nda1992 commented Dec 17, 2018

Hi,i want to get the hdf5 format file with BiLM weights corresponding this ELMO,how can i do it?Hope to get your reply,thank you.

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