{ "cells": [ { "cell_type": "code", "id": "initial_id", "metadata": { "ExecuteTime": { "end_time": "2024-07-01T11:08:00.253851Z", "start_time": "2024-07-01T11:08:00.067738Z" }, "id": "initial_id" }, "source": [ "import torch\n", "from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, TrainingArguments\n", "device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")" ], "outputs": [], "execution_count": 2 }, { "cell_type": "code", "id": "df5ce2489db64f8d", "metadata": { "ExecuteTime": { "end_time": "2024-07-01T11:08:15.731889Z", "start_time": "2024-07-01T11:08:03.640950Z" }, "colab": { "base_uri": "https://localhost:8080/", "height": 205, "referenced_widgets": [ "6ecdc71d497b4ab7bc6dca2ace0bd656", "2af56a7c045d4bc294c6cb6d362a8120", "f5611ea1eab5406eb5796ffed1218a0c", "68855bdfbeed46e7b7e3d82a9b4c0988", "24b9e5603be54e72b2bcf99be716b97d", "64c42ce2cab04fb0aed8e65efebdfd11", "85fc022f4f1841e480af3f5496f36fe0", "2e384f5f20db45579dc708ede8b15c87", "c9409991f35d4966989cf936f88fe99a", "0f4ba7cacc6d49599f3178b738092e09", "ddf9f8decaf948bbb67b8f71610c31b1", "46756e51804c48ebbabee753ea455457", "f98f7a5726d6434d9087fe521e136795", "cc3c582d99d24da1b7bf1f8168961749", "81b3bc430cc7409f9f51cd222fb0ca0e", "f66bc695f26e4603ac38f23168e65763", "d4a74b31d8064a5bba43849ed4b6658b", "72731803b79343b0b6a61d722009b6b6", "0ff317589550455f8eef5021912dd27c", "7e110f5c777442c4aab4ea06a27a3dc1", "ae1843d43b0f4199ba61e8c9e962f2b3", "d72cd66e520a4eea83c06d7df23ccc0e" ] }, "id": "df5ce2489db64f8d", "outputId": "34a739e5-75cd-4f03-b6b2-15e4b767bb64" }, "source": [ "tokenizer = AutoTokenizer.from_pretrained(\"google/flan-t5-xl\")\n", "model = AutoModelForSeq2SeqLM.from_pretrained(\"google/flan-t5-xl\")" ], "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:89: UserWarning: \n", "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", "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", "You will be able to reuse this secret in all of your notebooks.\n", "Please note that authentication is recommended but still optional to access public models or datasets.\n", " warnings.warn(\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "Loading checkpoint shards: 0%| | 0/2 [00:00