{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "c975c670-97cc-453e-bba6-3639cf8d5e89", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/jue@together.xyz/miniconda3/envs/nebula-fav2/lib/python3.10/site-packages/tqdm/auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n", " from .autonotebook import tqdm as notebook_tqdm\n" ] } ], "source": [ "import json\n", "from datasets import load_dataset" ] }, { "cell_type": "code", "execution_count": 2, "id": "e818dca8-bd10-4b89-9fcd-5cd9252b4e07", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Found cached dataset hellaswag (/home/jue@together.xyz/.cache/huggingface/datasets/hellaswag/default/0.1.0/512a66dd8b1b1643ab4a48aa4f150d04c91680da6a4096498a5e5f799623d5ae)\n", "100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3/3 [00:00<00:00, 53.00it/s]\n" ] } ], "source": [ "task_name = 'hellaswag'\n", "data = load_dataset(task_name)\n", "data.shuffle(seed=42)\n", "with open(f'../seed_data{task_name}.jsonl', 'w') as f:\n", " for i_item, item in enumerate(data['train']):\n", " text = item['ctx'] + item['endings'][int(item['label'])]\n", " f.write(\n", " json.dumps({'text': text, 'source': task_name}) + '\\n'\n", " )" ] }, { "cell_type": "code", "execution_count": 3, "id": "c42aae00-be85-4b64-9325-f6a6139c6ee6", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Downloading builder script: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 3.38k/3.38k [00:00<00:00, 32.1MB/s]\n", "Downloading metadata: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1.91k/1.91k [00:00<00:00, 20.0MB/s]\n", "Downloading readme: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 6.60k/6.60k [00:00<00:00, 45.1MB/s]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "Downloading and preparing dataset boolq/default to /home/jue@together.xyz/.cache/huggingface/datasets/boolq/default/0.1.0/bf0dd57da941c50de94ae3ce3cef7fea48c08f337a4b7aac484e9dddc5aa24e5...\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "Downloading data files: 0%| | 0/2 [00:00