{ "cells": [ { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from rich import print as rprint" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import json\n", "\n", "content = json.load(open('/Users/dhruvanand/Downloads/tokenizer.json'))" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "131" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(content[\"added_tokens\"])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
dict_keys(['type', 'dropout', 'unk_token', 'continuing_subword_prefix', 'end_of_word_suffix', 'fuse_unk', \n",
       "'byte_fallback', 'ignore_merges', 'vocab', 'merges'])\n",
       "
\n" ], "text/plain": [ "\u001b[1;35mdict_keys\u001b[0m\u001b[1m(\u001b[0m\u001b[1m[\u001b[0m\u001b[32m'type'\u001b[0m, \u001b[32m'dropout'\u001b[0m, \u001b[32m'unk_token'\u001b[0m, \u001b[32m'continuing_subword_prefix'\u001b[0m, \u001b[32m'end_of_word_suffix'\u001b[0m, \u001b[32m'fuse_unk'\u001b[0m, \n", "\u001b[32m'byte_fallback'\u001b[0m, \u001b[32m'ignore_merges'\u001b[0m, \u001b[32m'vocab'\u001b[0m, \u001b[32m'merges'\u001b[0m\u001b[1m]\u001b[0m\u001b[1m)\u001b[0m\n" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "rprint(content[\"model\"].keys())" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "base", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.12" } }, "nbformat": 4, "nbformat_minor": 2 }