{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "In this notebook, we showcase how to use the KVpress pipelines by answering questions about NVIDIA Wikipedia article." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import requests\n", "from bs4 import BeautifulSoup\n", "\n", "from transformers import pipeline\n", "\n", "from kvpress import ExpectedAttentionPress, KnormPress, RandomPress" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# Load the pipeline and data" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "54a814620e6844aba021ea3376c6f823", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Loading checkpoint shards: 0%| | 0/5 [00:00