|
83 | 83 | "name": "stdout",
|
84 | 84 | "output_type": "stream",
|
85 | 85 | "text": [
|
86 |
| - "huggingface_hub version: 0.24.7\n", |
| 86 | + "huggingface_hub version: 0.33.0\n", |
87 | 87 | "sentencepiece version: 0.2.0\n",
|
88 |
| - "torch version: 2.4.1+cu121\n" |
| 88 | + "torch version: 2.6.0\n" |
89 | 89 | ]
|
90 | 90 | }
|
91 | 91 | ],
|
|
1097 | 1097 | "id": "3357a230-b678-4691-a238-257ee4e80185",
|
1098 | 1098 | "outputId": "768ed6af-ce14-40bc-ca18-117b4b448269"
|
1099 | 1099 | },
|
1100 |
| - "outputs": [ |
1101 |
| - { |
1102 |
| - "name": "stdout", |
1103 |
| - "output_type": "stream", |
1104 |
| - "text": [ |
1105 |
| - "The token has not been saved to the git credentials helper. Pass `add_to_git_credential=True` in this function directly or `--add-to-git-credential` if using via `huggingface-cli` if you want to set the git credential as well.\n", |
1106 |
| - "Token is valid (permission: read).\n", |
1107 |
| - "Your token has been saved to /root/.cache/huggingface/token\n", |
1108 |
| - "Login successful\n" |
1109 |
| - ] |
1110 |
| - } |
1111 |
| - ], |
| 1100 | + "outputs": [], |
1112 | 1101 | "source": [
|
1113 | 1102 | "from huggingface_hub import login\n",
|
1114 | 1103 | "import json\n",
|
|
1155 | 1144 | "id": "69714ea8-b9b8-4687-8392-f3abb8f93a32",
|
1156 | 1145 | "outputId": "c230fec9-5c71-4a41-90ab-8a34d114ea01"
|
1157 | 1146 | },
|
1158 |
| - "outputs": [ |
1159 |
| - { |
1160 |
| - "name": "stderr", |
1161 |
| - "output_type": "stream", |
1162 |
| - "text": [ |
1163 |
| - "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:89: UserWarning: \n", |
1164 |
| - "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", |
1165 |
| - "To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n", |
1166 |
| - "You will be able to reuse this secret in all of your notebooks.\n", |
1167 |
| - "Please note that authentication is recommended but still optional to access public models or datasets.\n", |
1168 |
| - " warnings.warn(\n" |
1169 |
| - ] |
1170 |
| - }, |
1171 |
| - { |
1172 |
| - "data": { |
1173 |
| - "application/vnd.jupyter.widget-view+json": { |
1174 |
| - "model_id": "e6c75a6aa7b942fe84160e286e3acb3d", |
1175 |
| - "version_major": 2, |
1176 |
| - "version_minor": 0 |
1177 |
| - }, |
1178 |
| - "text/plain": [ |
1179 |
| - "tokenizer.model: 0%| | 0.00/500k [00:00<?, ?B/s]" |
1180 |
| - ] |
1181 |
| - }, |
1182 |
| - "metadata": {}, |
1183 |
| - "output_type": "display_data" |
1184 |
| - } |
1185 |
| - ], |
| 1147 | + "outputs": [], |
1186 | 1148 | "source": [
|
1187 | 1149 | "from huggingface_hub import hf_hub_download\n",
|
1188 | 1150 | "\n",
|
|
1222 | 1184 | " self.tokenizer = sp\n",
|
1223 | 1185 | "\n",
|
1224 | 1186 | " def encode(self, text):\n",
|
1225 |
| - " return self.tokenizer.encode_as_ids(text)\n", |
| 1187 | + " return self.tokenizer.encode(text, out_type=int)\n", |
1226 | 1188 | "\n",
|
1227 | 1189 | " def decode(self, ids):\n",
|
1228 |
| - " return self.tokenizer.decode_pieces(ids)\n", |
| 1190 | + " return self.tokenizer.decode(ids)\n", |
1229 | 1191 | "\n",
|
1230 | 1192 | "\n",
|
1231 | 1193 | "tokenizer = LlamaTokenizer(tokenizer_file)"
|
|
1258 | 1220 | "output_type": "stream",
|
1259 | 1221 | "text": [
|
1260 | 1222 | "Output text:\n",
|
1261 |
| - " Every effort movesαllRadius deletingpretcc否']; future eer napulate lackус während inter DES издаSchéon로жа Bass differencespadxsnu ;; ctx始\n" |
| 1223 | + " Every effort movesαllRadius deletingpretcc否']; future eer napulate lackус während inter DES издаSchéonkkarto Оryptato#{ningproof eerbye\n" |
1262 | 1224 | ]
|
1263 | 1225 | }
|
1264 | 1226 | ],
|
|
0 commit comments