Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed Mar 8, 2025
1 parent 92f473e commit 9fb2bf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/basic-tests-linux-uv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ jobs:
shell: bash
run: |
source .venv/bin/activate
pytest ch02/05_bpe-from-scratch test.py
pytest ch02/05_bpe-from-scratch/test.py
5 changes: 3 additions & 2 deletions ch02/05_bpe-from-scratch/bpe-from-scratch.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,10 @@
" with open(vocab_path, \"w\", encoding=\"utf-8\") as file:\n",
" json.dump(self.vocab, file, ensure_ascii=False, indent=2)\n",
"\n",
" merges_list = [{\"pair\": list(pair), \"new_id\": new_id}\n",
" for pair, new_id in self.bpe_merges.items()]\n",
" # Save BPE merges as a list of dictionaries\n",
" with open(bpe_merges_path, \"w\", encoding=\"utf-8\") as file:\n",
" merges_list = [{\"pair\": list(pair), \"new_id\": new_id}\n",
" for pair, new_id in self.bpe_merges.items()]\n",
" json.dump(merges_list, file, ensure_ascii=False, indent=2)\n",
"\n",
" def load_vocab_and_merges(self, vocab_path, bpe_merges_path):\n",
Expand Down

0 comments on commit 9fb2bf0

Please sign in to comment.