{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "5a7c444a-5800-45c3-9cfa-8a73de12c8e5", "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "os.environ[\"HF_HOME\"] = \"/workspace/local-HF-cache/\"\n", "os.environ[\"HF_HUB_ENABLE_HF_TRANSFER\"] = \"1\"\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "5dd927f1-1cad-43ac-ae9c-817e75048350", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "NVIDIA GeForce RTX 4090 (compute capability 8.9) supports NVIDIA Ampere or later, enabled TF32 in PyTorch.\n" ] } ], "source": [ "import torch\n", "\n", "from textsum.utils import check_ampere_gpu\n", "check_ampere_gpu() # automatically enables TF32 if Ampere+ available\n" ] }, { "cell_type": "code", "execution_count": 3, "id": "0c252525-7f63-4da1-8c9c-f939873cc484", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "12/05/2024 05:46:29 INFO PyTorch version 2.4.1+cu124 available.\n" ] }, { "data": { "text/plain": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['title', 'summary_official', 'metadata', 'source', 'summary_chunks', 'summary_generated'],\n", " num_rows: 1315\n", " })\n", "})" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from datasets import load_dataset\n", "\n", "# Login using e.g. `huggingface-cli login` to access this dataset\n", "ds = load_dataset(\"pszemraj/scriptbase-pegX-summaries\", \"no-text-4beams\")\n", "ds" ] }, { "cell_type": "code", "execution_count": 4, "id": "d1be6062-f813-496d-b15f-4db98b02d66f", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3cf7628f7d1e403d9339a1bb46a13610", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading shards: 0%| | 0/3 [00:00