Skip to content
This repository was archived by the owner on Oct 31, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions trax/examples/NMT_with_Transformers_Reformers_using_Trax.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,15 @@
"\n",
"```python\n",
"def train_stream_fn():\n",
" # open the first language file (e.g. English sentences)\n",
" with open('lang1.csv','r') as f1:\n",
" # open the second language file (e.g. French sentences)\n",
" with open('lang2.csv','r') as f2:\n",
" # looping over the two files to combine the two translation toghether and yields them.\n",
" for l1, l2 in zip(f1,f2):\n",
" yield (l1, l2)\n",
" # provide an infinite generator",
" while True:",
" # open the first language file (e.g. English sentences)\n",
" with open('lang1.csv','r') as f1:\n",
" # open the second language file (e.g. French sentences)\n",
" with open('lang2.csv','r') as f2:\n",
" # looping over the two files to combine the two translation toghether and yields them.\n",
" for l1, l2 in zip(f1,f2):\n",
" yield (l1, l2)\n",
"```"
]
},
Expand Down