{ "cells": [ { "cell_type": "code", "execution_count": 11, "id": "addd199c-097c-419d-a0f2-c3d73efb8d5d", "metadata": {}, "outputs": [], "source": [ "import json\n", "import os\n", "from pprint import pprint\n", "\n", "import bitsandbytes as bnb\n", "import pandas as pd\n", "import torch\n", "import torch.nn as nn\n", "\n", "import transformers\n", "from datasets import load_dataset\n", "from huggingface_hub import notebook_login\n", "from peft import (\n", " LoraConfig,\n", " PeftConfig,\n", " PeftModel,\n", " get_peft_model,\n", " prepare_model_for_kbit_training,\n", ")\n", "from transformers import (\n", " AutoConfig,\n", " AutoModelForCausalLM,\n", " AutoTokenizer,\n", " BitsAndBytesConfig,\n", ")\n", "import warnings\n", "warnings.filterwarnings(\"ignore\")\n", "\n", "os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"" ] }, { "cell_type": "code", "execution_count": 2, "id": "acfb1578-a66f-44f0-8df9-1c6bcf7530ea", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "b92bb6f7a2784be8bf5cab2ee87292ff", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='
\n", " | question | \n", "answer | \n", "
---|---|---|
0 | \n", "Problem:\\nI have the following dataframe:\\nind... | \n", "import pandas as pd\\n\\n\\nindex = range(14)\\nda... | \n", "
1 | \n", "Problem:\\ni got an issue over ranking of date ... | \n", "import pandas as pd\\n\\n\\ndf = pd.DataFrame({'I... | \n", "
2 | \n", "Problem:\\nI have a DataFrame like :\\n 0 ... | \n", "import pandas as pd\\nimport numpy as np\\n\\ndf ... | \n", "
3 | \n", "Problem:\\nI have this Pandas dataframe (df):\\n... | \n", "import pandas as pd\\n\\n\\ndf = pd.DataFrame({'A... | \n", "
4 | \n", "Problem:\\nI have\\n\\ndf = pd.DataFrame.from_dic... | \n", "import pandas as pd\\n\\ndf = pd.DataFrame.from_... | \n", "