{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "6f46e840-8a7f-4be2-a082-49b9ebf5a8c5", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.1.2\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.2.1\u001b[0m\n", "\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpython3 -m pip install --upgrade pip\u001b[0m\n" ] } ], "source": [ "!pip install -q -U huggingface_hub peft transformers torch accelerate\n" ] }, { "cell_type": "code", "execution_count": 2, "id": "2d2918a1-d701-4a66-946c-6f668cb4ac1e", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Mon Jul 24 21:41:13 2023 \n", "+-----------------------------------------------------------------------------+\n", "| NVIDIA-SMI 525.105.17 Driver Version: 525.105.17 CUDA Version: 12.0 |\n", "|-------------------------------+----------------------+----------------------+\n", "| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n", "| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n", "| | | MIG M. |\n", "|===============================+======================+======================|\n", "| 0 NVIDIA H100 PCIe On | 00000000:06:00.0 Off | 0 |\n", "| N/A 39C P0 52W / 350W | 0MiB / 81559MiB | 0% Default |\n", "| | | Disabled |\n", "+-------------------------------+----------------------+----------------------+\n", " \n", "+-----------------------------------------------------------------------------+\n", "| Processes: |\n", "| GPU GI CI PID Type Process name GPU Memory |\n", "| ID ID Usage |\n", "|=============================================================================|\n", "| No running processes found |\n", "+-----------------------------------------------------------------------------+\n" ] } ], "source": [ "!nvidia-smi" ] }, { "cell_type": "code", "execution_count": 3, "id": "0afdf8a6-ea7d-44ab-a1f9-a19e550e9dbd", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/ubuntu/.local/lib/python3.8/site-packages/pandas/core/computation/expressions.py:20: UserWarning: Pandas requires version '2.7.3' or newer of 'numexpr' (version '2.7.1' currently installed).\n", " from pandas.core.computation.check import NUMEXPR_INSTALLED\n" ] } ], "source": [ "import torch\n", "from peft import PeftModel, PeftConfig\n", "from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig" ] }, { "cell_type": "code", "execution_count": 4, "id": "adfcd11e-8d98-4cf3-abf4-e9fa933eb0d6", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "7dc80313fdcd41a5a7ee168956df3dd9", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='