Skip to content

Commit

Permalink
polish gpt2 example
Browse files Browse the repository at this point in the history
  • Loading branch information
qkaren committed Apr 20, 2019
1 parent 25da80d commit 3efd3e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/gpt-2/gpt2_generate_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def main(_):

pos_embedder = tx.modules.PositionEmbedder(
position_size=gpt2_config.position_size,
hparams=gpt2_config.pos_embed
)
hparams=gpt2_config.pos_embed)

def _embedding_fn(x, y):
# `x` is token ids, `y` is time steps
return word_embedder(x) + pos_embedder(y)

helper = tx.modules.TopKSampleEmbeddingHelper(
Expand Down

0 comments on commit 3efd3e0

Please sign in to comment.