{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 463, "referenced_widgets": [ "9c6d9e6a50544c9995e5d1fb34ce5bbf", "f78bbbfa377c4bd2b5a5946114ca484c", "c5b72ec0471646f3ab7f88d5ad53090c", "93fc608ceb2f44e7a9b15d6156a06bf9", "1672f6b3bc9e46159f031b74ce3ed144", "677dc023b9804e89b6d9d2bbfc83695f", "6dd90705edc043bc927c16993b8c5488", "66ac11707cf6470d92e3f9343ff09abc", "4c55895f36a24f3db0f3e5f7ab2569f7", "74d13506d86a479f91ffbf005551d5c3", "0736f86fd3064137b08896362460956f", "8e1cd00d062840c5b89ef3a3f4e91c4c", "7dbcc9003bf64165b78b283e6414797c", "024165b43be34d03a8e5aa8993bc725c", "3367d714e42544ed9284e03e61f2cc6f", "33ff93aa63cf4f809913608bcfcfe63e", "37a50d693de849d996b44d03fd665700", "b786617df417426d9442339a45c62b45", "f8a66b59083946d6a120f67668b21039", "9ddba09925224a77910eb16354622dc0", "c49d80e4294a4a639a43510a226772ba", "412242d7449f4628965bad9ded98d161", "fd325ce55209445198c6ce3f0085446b", "1287365838664d61bb280128e5939073", "6198ebdc4dd24149ad9d8f885801930e", "17b3cc3134dc43b2b0157173e265844d", "1586f1bf936b45ab86bc2690f4f0cba4", "c8d2afbfbfad442a84ee650b0a30298c", "9351f0bf6c1b464a9b567f2581380e87", "91d25de4473546bba8a6984f3f4e795d", "5bb0b8d85ec14223bb8db395d3d07d14", "370305dff97b41ee9b761b6c77157dda", "63c9c35e0d524ce9beaab046d418a8b9", "3c9c845fc83e468bbfa2aecbe12cb6ac", "20d6abe392334f61886dfa0b8bf36c44", "37084800375e4aee8ddd7b728162baae", "057cfea9763e41d483c96c200f92edc7", "146a72b6aedb487badf0b4cafe799633", "fa56393935024d9d8ef27e58764c8853", "afae64463d5844d48dcf9eead39d7802", "0ab5bced75c54d65add98585839b12cc", "ebdacc9e0f2b4c64893d589ef9e0c294", "e31b9004de714db2b8304c7f55418a80", "90a77a45d1f04dd9897e6c11845cdb54", "6879f059d01b40b8a3b975eee51cfdf8", "e8bbfdf0b6834576bf65a9fb0da1a045", "9482979370f34775a77709f51c36d5f5", "423c222dfd3a4dba8642fa52cfe12482", "13f00d9e6db04eca8db6c0e86ac8d90b", "d817bee05a0d4467bc345a77258ef9e3", "33e9bfa6c830413c92aa0a4d1f7f40e1", "211f785a3ae94336ad638f5145a6fe30", "c51a8cafb47c4ceea4fa6dbdc2f2a707", "34b3ca045b2346a9b1d1f1aec660a3b1", "7517f0a4154149d38b34bb8496a933f6", "1aba0b1ba86a4c10b06a872729ead200", "e7c184e9b07546bd83c01f29b511f5b9", "6ed503e50aad41fab644fb2cc6aabf7a", "6257af81cc5140048be1e1c77bc5abd7", "5215039129d1429c8e11bc83f366c72e", "2d247e7c501043a0b3bf01f11ee7c179", "2f96f6378d164432a4e08e0668a16bf3", "b05608e145fb4aaabb092f24345d9b3c", "58f3eae29c374deca2bd6c369d9e1861", "1c47a8f001ca470fb7cd8e3a287d5c1b", "67fefe5ea6294d03bb22f3d3fb4324bd", "8cb90a7463b04db0b78bd8c62cf3fa61", "9eba9c4ec6784184a08a00308adc2af5", "18b037f60e3940038530c8dee93d4341", "9da246ebde274853890e0810a951f05f", "cf82c30e40a649a7b65579e26151bea6", "2217529eaee74048a485703662e09e9d", "d71ca048103e4bab883dbb0a329fd4e6", "d53a1190caf94ca19f031a00a53801d1", "d311660f8bca4fff9b1705fbe1490d10", "c0a91b7164e8473fbf04a54f5effb5ef", "f5a8e787cfbc4d2782f214d3b827ad81", "335b556a4c4844d0a11706a7c35abdd3", "c9a38fc7797146848adc2cb435f12d7b", "f4c8e3495bae4bd1af4764f1b798df1b", "e7e054227c92482cb9024050337e214d", "8e3bd58109c84e74b8cee8a1c946e9d8", "57d527462a4e414aac7b15293888c38f", "b2276cd6a47e4752b33ad9373c21ce33", "c6b561ca04a34d85ba5c5060bb5a6cd1", "55982df74e894c5cbc9991935e026cf8", "30be193f02524249962fc1d6e63add61", "33417f93da82493eb592c2462049708d" ] }, "id": "omzcYin2mREa", "outputId": "bd62ed8b-a021-47fe-b626-85d7073469ac" }, "outputs": [ { "output_type": "stream", "name": "stderr", "text": [ "/usr/local/lib/python3.12/dist-packages/huggingface_hub/utils/_auth.py:94: 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": [ "config.json: 0.00B [00:00, ?B/s]" ], "application/vnd.jupyter.widget-view+json": { "version_major": 2, "version_minor": 0, "model_id": "9c6d9e6a50544c9995e5d1fb34ce5bbf" } }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "tokenizer_config.json: 0%| | 0.00/847 [00:00" ], "text/html": [ "\n", " \n", " \n", " Upload widget is only available when the cell has been executed in the\n", " current browser session. Please rerun this cell to enable.\n", " \n", " " ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Saving syscred_presentation.pdf to syscred_presentation.pdf\n", "Fichier chargé : syscred_presentation.pdf\n" ] } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 325, "referenced_widgets": [ "2ed9f6941c524b97a875c7da39acad71", "257a1cc4f3074394b667f8859330b4d1", "60aca77f677c48a9a2ea93fc33c957c3", "cac8e210254849888455019069b30bfc", "e9ed91f560744799bb25937713daf018", "101c99d4e2a845f18ef57ec90b1fc266", "bf1f88e95e47419a8e2daaef40826087", "15f4385eb1f146dcbdcf35f0e06ce446", "e59efe104aa3435c9403de2e57cb240b", "7c0a80f1601c40eeaac82b55c740efd4", "7ea91506e5964bfead1293e32ec96ebe" ] }, "id": "e9f83722", "outputId": "f08bef72-b41b-4ec8-b3d3-8b4fc51a2794" }, "source": [ "!pip install pymupdf\n", "\n", "import fitz # PyMuPDF\n", "import os\n", "from google.colab import files\n", "from tqdm.auto import tqdm\n", "\n", "# 1. Sélection et Upload du fichier\n", "print('Veuillez sélectionner votre fichier (.pdf ou .tex) :')\n", "uploaded = files.upload()\n", "\n", "if uploaded:\n", " uploaded_file_name = list(uploaded.keys())[0]\n", " file_extension = os.path.splitext(uploaded_file_name)[1].lower()\n", "\n", " def extract_text_from_file(file_path, extension):\n", " if extension == '.pdf':\n", " text = \"\"\n", " with fitz.open(file_path) as doc:\n", " for page in doc:\n", " text += page.get_text()\n", " return text\n", " elif extension == '.tex':\n", " with open(file_path, 'r', encoding='utf-8') as f:\n", " return f.read()\n", " return \"\"\n", "\n", " # 2. Extraction et Découpage (get_chunks et tokenizer doivent être initialisés)\n", " raw_text = extract_text_from_file(uploaded_file_name, file_extension)\n", " try:\n", " chunks = get_chunks(raw_text, tokenizer)\n", " except NameError:\n", " print(\"Erreur : Veuillez d'abord exécuter la cellule 99afb542 pour initialiser le tokenizer et les fonctions.\")\n", " chunks = []\n", "\n", " if chunks:\n", " print(f'Fichier chargé : {uploaded_file_name}')\n", " print(f'Le document contient {len(chunks)} segments à traduire.')\n", "\n", " # 3. Traduction par lots\n", " resultats_traduction = []\n", " for segment in tqdm(chunks, desc=\"Traduction en cours\"):\n", " inputs = tokenizer(segment, return_tensors='pt', truncation=True, max_length=512)\n", " outputs = model.generate(**inputs)\n", " resultats_traduction.append(tokenizer.decode(outputs[0], skip_special_tokens=True))\n", "\n", " # 4. Assemblage final et Sauvegarde\n", " traduction_complete = \"\\n\\n\".join(resultats_traduction)\n", " output_filename = f\"translated_{os.path.splitext(uploaded_file_name)[0]}.txt\"\n", " with open(output_filename, 'w', encoding='utf-8') as f:\n", " f.write(traduction_complete)\n", "\n", " print(f'\\nTraduction terminée ! Fichier : {output_filename}')\n", " files.download(output_filename)\n", "else:\n", " print('Aucun fichier sélectionné.')" ], "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Collecting pymupdf\n", " Downloading pymupdf-1.27.2-cp310-abi3-manylinux_2_28_x86_64.whl.metadata (3.4 kB)\n", "Downloading pymupdf-1.27.2-cp310-abi3-manylinux_2_28_x86_64.whl (24.9 MB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m24.9/24.9 MB\u001b[0m \u001b[31m83.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: pymupdf\n", "Successfully installed pymupdf-1.27.2\n", "Veuillez sélectionner votre fichier (.pdf ou .tex) :\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "\n", " \n", " \n", " Upload widget is only available when the cell has been executed in the\n", " current browser session. Please rerun this cell to enable.\n", " \n", " " ] }, "metadata": {} }, { "output_type": "stream", "name": "stderr", "text": [ "Token indices sequence length is longer than the specified maximum sequence length for this model (522 > 512). Running this sequence through the model will result in indexing errors\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "Saving syscred_presentation.pdf to syscred_presentation (1).pdf\n", "Fichier chargé : syscred_presentation (1).pdf\n", "Le document contient 9 segments à traduire.\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "Traduction en cours: 0%| | 0/9 [00:00" ], "application/javascript": [ "\n", " async function download(id, filename, size) {\n", " if (!google.colab.kernel.accessAllowed) {\n", " return;\n", " }\n", " const div = document.createElement('div');\n", " const label = document.createElement('label');\n", " label.textContent = `Downloading \"${filename}\": `;\n", " div.appendChild(label);\n", " const progress = document.createElement('progress');\n", " progress.max = size;\n", " div.appendChild(progress);\n", " document.body.appendChild(div);\n", "\n", " const buffers = [];\n", " let downloaded = 0;\n", "\n", " const channel = await google.colab.kernel.comms.open(id);\n", " // Send a message to notify the kernel that we're ready.\n", " channel.send({})\n", "\n", " for await (const message of channel.messages) {\n", " // Send a message to notify the kernel that we're ready.\n", " channel.send({})\n", " if (message.buffers) {\n", " for (const buffer of message.buffers) {\n", " buffers.push(buffer);\n", " downloaded += buffer.byteLength;\n", " progress.value = downloaded;\n", " }\n", " }\n", " }\n", " const blob = new Blob(buffers, {type: 'application/binary'});\n", " const a = document.createElement('a');\n", " a.href = window.URL.createObjectURL(blob);\n", " a.download = filename;\n", " div.appendChild(a);\n", " a.click();\n", " div.remove();\n", " }\n", " " ] }, "metadata": {} }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "application/javascript": [ "download(\"download_a05cb3c2-674e-4842-b119-3f56784a0a85\", \"translated_syscred_presentation (1).txt\", 563)" ] }, "metadata": {} } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "install_deps_final", "outputId": "f5bf7a3f-4a32-494a-c689-02cce4ff8630" }, "source": [ "!pip install pymupdf\n", "import fitz\n", "print(f'PyMuPDF version installed: {fitz.__version__}')" ], "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: pymupdf in /usr/local/lib/python3.12/dist-packages (1.27.2)\n", "PyMuPDF version installed: 1.27.2\n" ] } ] }, { "cell_type": "code", "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "install_pymupdf", "outputId": "c5c1e085-4e1f-4208-e0be-2af30e500658" }, "source": [ "!pip install pymupdf" ], "execution_count": null, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: pymupdf in /usr/local/lib/python3.12/dist-packages (1.27.2)\n" ] } ] }, { "cell_type": "code", "metadata": { "id": "install_deps_v2" }, "source": [ "!pip install pymupdf" ], "execution_count": null, "outputs": [] }, { "cell_type": "markdown", "metadata": { "id": "9f42caa8" }, "source": [ "# Task\n", "Build a complete PDF and LaTeX translation pipeline using the `DomLoyer/opus-mt-fr-en-finetuned-fr-to-en` model. The system must:\n", "1. **Install Dependencies**: Install `PyMuPDF` (fitz) for PDF processing and `sacremoses` for the translation model.\n", "2. **File Upload**: Implement a mechanism to upload `.pdf` or `.tex` files.\n", "3. **Text Extraction & Chunking**: Extract text from the uploaded documents and split it into manageable chunks (under 512 tokens) to avoid the `IndexError` encountered previously.\n", "4. **Batch Translation**: Process each chunk through the model, implement a progress bar, and reassemble the translated text.\n", "5. **Export**: Provide the final translated content for download." ] }, { "cell_type": "markdown", "metadata": { "id": "31a9bbdb" }, "source": [ "## Install Dependencies\n", "\n", "### Subtask:\n", "Install the necessary libraries for PDF processing, LaTeX handling, and model-specific tokenization requirements.\n" ] }, { "cell_type": "markdown", "metadata": { "id": "17c8d696" }, "source": [ "**Reasoning**:\n", "Install the required libraries `pymupdf` (fitz) and `sacremoses` to handle PDF processing and satisfy model tokenization requirements as specified in the instructions.\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "650a2113", "outputId": "ff964def-e241-4f76-df82-1769376a2580" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Requirement already satisfied: pymupdf in /usr/local/lib/python3.12/dist-packages (1.27.2)\n", "Collecting sacremoses\n", " Downloading sacremoses-0.1.1-py3-none-any.whl.metadata (8.3 kB)\n", "Requirement already satisfied: regex in /usr/local/lib/python3.12/dist-packages (from sacremoses) (2025.11.3)\n", "Requirement already satisfied: click in /usr/local/lib/python3.12/dist-packages (from sacremoses) (8.3.1)\n", "Requirement already satisfied: joblib in /usr/local/lib/python3.12/dist-packages (from sacremoses) (1.5.3)\n", "Requirement already satisfied: tqdm in /usr/local/lib/python3.12/dist-packages (from sacremoses) (4.67.3)\n", "Downloading sacremoses-0.1.1-py3-none-any.whl (897 kB)\n", "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m897.5/897.5 kB\u001b[0m \u001b[31m14.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", "\u001b[?25hInstalling collected packages: sacremoses\n", "Successfully installed sacremoses-0.1.1\n", "PyMuPDF version: 1.27.2\n", "sacremoses successfully imported.\n" ] } ], "source": [ "!pip install pymupdf sacremoses\n", "\n", "import fitz\n", "import sacremoses\n", "print(f'PyMuPDF version: {fitz.__version__}')\n", "print('sacremoses successfully imported.')" ] }, { "cell_type": "markdown", "metadata": { "id": "43346b7d" }, "source": [ "## Upload Functionality\n", "\n", "### Subtask:\n", "Implement a file upload mechanism to allow users to import PDF or .tex files into the Colab environment.\n" ] }, { "cell_type": "markdown", "metadata": { "id": "6beda08b" }, "source": [ "**Reasoning**:\n", "I will implement the file upload functionality as requested, allowing users to upload .pdf or .tex files and validating the extension.\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 103 }, "id": "6f74fbec", "outputId": "a9b91e74-9663-45ea-ed66-69c653e4f864" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Please upload your .pdf or .tex file:\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "" ], "text/html": [ "\n", " \n", " \n", " Upload widget is only available when the cell has been executed in the\n", " current browser session. Please rerun this cell to enable.\n", " \n", " " ] }, "metadata": {} }, { "output_type": "stream", "name": "stdout", "text": [ "Saving DIC9401_2111_1830.tex to DIC9401_2111_1830.tex\n", "Successfully uploaded: DIC9401_2111_1830.tex\n" ] } ], "source": [ "from google.colab import files\n", "import os\n", "\n", "print('Please upload your .pdf or .tex file:')\n", "uploaded = files.upload()\n", "\n", "if uploaded:\n", " filename = list(uploaded.keys())[0]\n", " ext = os.path.splitext(filename)[1].lower()\n", "\n", " if ext in ['.pdf', '.tex']:\n", " print(f'Successfully uploaded: {filename}')\n", " # Store filename for later use\n", " uploaded_file_path = filename\n", " else:\n", " print(f'Error: Unsupported file type ({ext}). Please upload a .pdf or .tex file.')\n", "else:\n", " print('No file was uploaded.')" ] }, { "cell_type": "markdown", "metadata": { "id": "371358d5" }, "source": [ "## Document Processing and Chunking\n", "\n", "### Subtask:\n", "Extract text from the uploaded .pdf or .tex file and split it into segments under 512 tokens to prevent model errors.\n" ] }, { "cell_type": "markdown", "metadata": { "id": "9e8b8942" }, "source": [ "**Reasoning**:\n", "I will implement the text extraction for PDF and LaTeX files and create a chunking mechanism that respects the 512-token limit of the translation model to avoid indexing errors.\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "efa49f2d", "colab": { "base_uri": "https://localhost:8080/" }, "outputId": "b74899db-3a63-4424-8b11-ee7b2130594d" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Extracted 50404 characters.\n" ] }, { "output_type": "stream", "name": "stderr", "text": [ "Token indices sequence length is longer than the specified maximum sequence length for this model (551 > 512). Running this sequence through the model will result in indexing errors\n" ] }, { "output_type": "stream", "name": "stdout", "text": [ "Split text into 38 chunks.\n", "First chunk tokens: 400\n" ] } ], "source": [ "import fitz\n", "import os\n", "\n", "def extract_text(file_path):\n", " ext = os.path.splitext(file_path)[1].lower()\n", " text = \"\"\n", " if ext == '.pdf':\n", " doc = fitz.open(file_path)\n", " for page in doc:\n", " text += page.get_text(\"text\") + \"\\n\"\n", " doc.close()\n", " elif ext == '.tex':\n", " with open(file_path, 'r', encoding='utf-8') as f:\n", " text = f.read()\n", " return text\n", "\n", "# 1. Extract raw text\n", "raw_text = extract_text(uploaded_file_path)\n", "print(f'Extracted {len(raw_text)} characters.')\n", "\n", "# 2. Initialize tokenizer for chunking\n", "from transformers import AutoTokenizer\n", "tokenizer = AutoTokenizer.from_pretrained(\"DomLoyer/opus-mt-fr-en-finetuned-fr-to-en\")\n", "\n", "# 3 & 4. Chunking strategy respecting sentence boundaries and token limit\n", "def get_chunks(text, tokenizer, max_tokens=500):\n", " sentences = text.replace('\\n', ' ').split('. ')\n", " chunks = []\n", " current_chunk = \"\"\n", "\n", " for sentence in sentences:\n", " test_sentence = sentence + \". \"\n", " # Check if adding the next sentence exceeds the limit\n", " combined_tokens = len(tokenizer.encode(current_chunk + test_sentence))\n", "\n", " if combined_tokens < max_tokens:\n", " current_chunk += test_sentence\n", " else:\n", " if current_chunk:\n", " chunks.append(current_chunk.strip())\n", "\n", " # If a single sentence is too long, split it by words (fallback)\n", " if len(tokenizer.encode(test_sentence)) >= max_tokens:\n", " words = test_sentence.split(' ')\n", " temp_subchunk = \"\"\n", " for word in words:\n", " if len(tokenizer.encode(temp_subchunk + word + \" \")) < max_tokens:\n", " temp_subchunk += word + \" \"\n", " else:\n", " chunks.append(temp_subchunk.strip())\n", " temp_subchunk = word + \" \"\n", " current_chunk = temp_subchunk\n", " else:\n", " current_chunk = test_sentence\n", "\n", " if current_chunk:\n", " chunks.append(current_chunk.strip())\n", " return chunks\n", "\n", "# 5. Store result\n", "text_chunks = get_chunks(raw_text, tokenizer)\n", "print(f'Split text into {len(text_chunks)} chunks.')\n", "if text_chunks:\n", " print(f'First chunk tokens: {len(tokenizer.encode(text_chunks[0]))}')" ] }, { "cell_type": "markdown", "metadata": { "id": "70f23991" }, "source": [ "## Batch Translation\n", "\n", "### Subtask:\n", "Translate the pre-processed text chunks using the fine-tuned Marian MT model and monitor progress with a progress bar.\n" ] }, { "cell_type": "markdown", "metadata": { "id": "df044056" }, "source": [ "**Reasoning**:\n", "I will implement the batch translation logic by iterating through the previously created text chunks, using the model to generate translations with GPU acceleration if available, and tracking progress with tqdm.\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "79cf859c", "colab": { "base_uri": "https://localhost:8080/", "height": 251, "referenced_widgets": [ "0b505398527e4a53ae2e16c7f501e85e", "137fc476fc474b748320acb0c6420297", "3e604a7c2b864d1f8b0d80b1ac616f53", "d02372da33d54c8b8d5a8ba41cd48f1f", "644838ebaac14ecdb11d18148ddeb383", "1e208e21c8754c8f8eb608503dee1ab7", "872b1a490cad4578ad23b74b11dfebf7", "8823350767944c39868a142f70016e4e", "6af115ec1d3b4c0bbd7e08ca8c3a1734", "0a04ff9a9aba4a32909c4963689d7069", "47faa012bde04078a38bb4dd901c354a", "974c067a6bb649a9bac11018dca4ebec", "fa53c8e3bdfe405f8cbd6865a13f53fc", "602f976ef7874bc386978792ed8d9912", "33ebd70ee2d540bdb8cb941c570d92ba", "48d2b9f8b28946e6b82c3797d6e017fb", "2e455b7048e4478b93253ba60b461e49", "c7ec175aecfe47a0a9988f069cd1999c", "4e5ed8f4b58c4be7a6716b42008b0578", "093684fafaa54388bb63ddb96dcef20a", "8711d8dc4d224977aa0c13a8723ced5d", "179f43abb2fe41b1abc9f30ca15cf9d2" ] }, "outputId": "ce196620-c542-40c8-b8c9-8b1a5e5b5142" }, "outputs": [ { "output_type": "stream", "name": "stdout", "text": [ "Using device: cuda\n" ] }, { "output_type": "display_data", "data": { "text/plain": [ "Loading weights: 0%| | 0/254 [00:00