DSPy: The framework for programming—not prompting—language models
Python
test local install
Jasper Xianf6da7820bec4
diff --git a/pyserini.ipynb b/pyserini.ipynbindex 2ed64a5ae..7edacc336 100644--- a/pyserini.ipynb+++ b/pyserini.ipynb@@ -14,14 +14,23 @@"metadata": {},"source": ["## 1. Installation/Setup\n",- "Using `dspy.Pyserini` will require installing pyserini, Pytorch, and Faiss. Pyserini can be installed with `pip install pyserini`, and we'll leave it to you to decide the right versions of Pytorch and Faiss to install."+ "Using `dspy.Pyserini` will require installing pyserini, Pytorch, and Faiss. Pyserini can be installed with `pip install pyserini`, and if you're on your own device we'll leave it to you to decide the right versions of Pytorch and Faiss to install."]},{"cell_type": "code",- "execution_count": null,+ "execution_count": 1,"metadata": {},- "outputs": [],+ "outputs": [+ {+ "name": "stderr",+ "output_type": "stream",+ "text": [+ "/tmp/ipykernel_2513/4167226831.py:5: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html\n",+ " import pkg_resources\n"+ ]+ }+ ],"source": ["%load_ext autoreload\n","%autoreload 2\n",@@ -29,9 +38,11 @@"import sys\n","import pkg_resources \n","\n",- "try: # When on google Colab, let's clone the notebook so we download the cache.\n",+ "try: # When on Colab, let's install pyserini, Pytorch, and Faiss\n"," import google.colab\n"," repo_path = 'dspy'\n",+ " !git -C $repo_path pull origin || git clone https://github.com/jasper-xian/dspy.git $repo_path\n",+ " !git checkout pyserini-colab\n"," if not \"pyserini\" in {pkg.key for pkg in pkg_resources.working_set}:\n"," !pip install pyserini\n"," if not \"torch\" in {pkg.key for pkg in pkg_resources.working_set}:\n",@@ -62,7 +73,7 @@},{"cell_type": "code",- "execution_count": 1,+ "execution_count": 2,"metadata": {},"outputs": [{@@ -193,7 +204,7 @@},{"cell_type": "code",- "execution_count": 2,+ "execution_count": 3,"metadata": {},"outputs": [{