HIT-SCIR/ELMoForManyLangs

A bug on elmo.py

Just4Uzi opened this issue · 5 comments

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

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

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

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.

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

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.