From 54b316ca1cca5809ec97495e79175eb586c13fd8 Mon Sep 17 00:00:00 2001 From: trueroyce Date: Thu, 9 Jan 2025 02:36:47 +0000 Subject: [PATCH] Added news_fake_example.ipynb and updated retnet/somefile.py for compatibility --- news_fake_example.ipynb | 612 ++++++++++++++++++++++++++++++++++++++ retnet/modeling_retnet.py | 2 +- 2 files changed, 613 insertions(+), 1 deletion(-) create mode 100644 news_fake_example.ipynb diff --git a/news_fake_example.ipynb b/news_fake_example.ipynb new file mode 100644 index 0000000..d89f353 --- /dev/null +++ b/news_fake_example.ipynb @@ -0,0 +1,612 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 3, + "id": "bb6eb078", + "metadata": {}, + "outputs": [], + "source": [ + "# !pip install transformers==4.38.2\n", + " " + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "c555460c", + "metadata": {}, + "outputs": [], + "source": [ + "import torch\n", + "from retnet.modeling_retnet import RetNetForSequenceClassification\n", + "from retnet.configuration_retnet import load_config_from_json\n", + "from transformers import AutoTokenizer, TextStreamer\n", + "from datasets import load_dataset\n", + "\n", + "from retnet.configuration_retnet import RetNetConfig\n", + "\n", + "import wandb" + ] + }, + { + "cell_type": "markdown", + "id": "74d4285a", + "metadata": {}, + "source": [ + "## Dataset" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "10092094", + "metadata": {}, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "49301758b2e04e24ab743e6282f75d08", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "README.md: 0%| | 0.00/786 [00:00