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

fix protobuf size limit of seq2seq demo #730

Merged
merged 3 commits into from
Dec 5, 2016
Merged

fix protobuf size limit of seq2seq demo #730

merged 3 commits into from
Dec 5, 2016

Conversation

luotao1
Copy link
Contributor

@luotao1 luotao1 commented Dec 5, 2016

  1. fix seq2seq error #718 :按照increase protobuffer message size #170 ,修改seq2seq中define_py_data_sources2的args参数,将直接传递字典改成传递字典地址,并写入FAQ中。
  2. 将seq2seq demo中的slots和yield改为显示指定。

@reyoung reyoung removed their assignment Dec 5, 2016
@reyoung
Copy link
Collaborator

reyoung commented Dec 5, 2016

@qingqing01 Please review this PR. If you want help, then assign me.

I think this PR could be reviewed by one person.

settings.job_mode = not is_generating
settings.src_dict = dict()
for line_count, line in enumerate(open(src_dict_path, "r")):
settings.src_dict[line.strip()] = line_count
Copy link
Contributor

@alvations alvations Dec 5, 2016

Choose a reason for hiding this comment

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

我自己的seqToseq代码用dictionary comprehension来初设化 src_dicttrg_dict。这样初设化会比较pythonic 吧 =)

with open(src_dict_path, "r") as fin:
    settings.src_dict = {line.strip():line_count for line_count, line in enumerate(fin)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

settings.trg_dict = dict()
for line_count, line in enumerate(open(trg_dict_path, "r")):
settings.trg_dict[line.strip()] = line_count

Copy link
Contributor

@alvations alvations Dec 5, 2016

Choose a reason for hiding this comment

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

同样的

with open(trg_dict_path, "r") as fin:
    settings.trg_dict = {line.strip():line_count for line_count, line in enumerate(fin)}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

settings.trg_dict = {
line.strip(): line_count
for line_count, line in enumerate(fin)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

def fun(): 然后调用两次也可以~

@qingqing01 qingqing01 merged commit f93af82 into PaddlePaddle:develop Dec 5, 2016
@luotao1 luotao1 deleted the demo branch December 6, 2016 02:12
@luotao1 luotao1 mentioned this pull request Dec 6, 2016
wangxicoding pushed a commit to wangxicoding/Paddle that referenced this pull request Dec 9, 2021
111行if语句写错了
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.

seq2seq error
4 participants