Skip to content

Commit 07ceba6

Browse files
authored
Adding pypi packaging support (#51)
* Adding pypi packaging support * Update version
1 parent 8905214 commit 07ceba6

File tree

5 files changed

+37
-21
lines changed

5 files changed

+37
-21
lines changed

README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
<p>Build and explore efficient retrieval-augmented generative models and applications</p>
88
</h4>
99

10-
:round_pushpin: <a href="#round_pushpin-installation">Installation</a> • :rocket: <a href="components.md">Components</a> • :books: <a href="examples.md">Examples</a> • :red_car: <a href="getting_started.md">Getting Started</a> • :pill: <a href="Demo.md">Demos</a> • :pencil2: <a href="scripts/README.md">Scripts</a> • :bar_chart: <a href="benchmarks/README.md">Benchmarks</a>
10+
![PyPI - Version](https://img.shields.io/pypi/v/fastrag)
11+
![PyPI - Downloads](https://img.shields.io/pypi/dm/fastrag)
1112

13+
:round_pushpin: <a href="#round_pushpin-installation">Installation</a> • :rocket: <a href="components.md">Components</a> • :books: <a href="examples.md">Examples</a> • :red_car: <a href="getting_started.md">Getting Started</a> • :pill: <a href="Demo.md">Demos</a> • :pencil2: <a href="scripts/README.md">Scripts</a> • :bar_chart: <a href="benchmarks/README.md">Benchmarks</a>
1214

1315
</div>
1416

@@ -105,13 +107,21 @@ Preliminary requirements:
105107
- **Python** 3.8 or higher.
106108
- **PyTorch** 2.0 or higher.
107109

108-
To set up the software, clone the project and run the following, preferably in a newly created virtual environment:
110+
To set up the software, install from `pip` or clone the project for the bleeding-edge updates. Run the following, preferably in a newly created virtual environment:
111+
112+
via `pip` pypi:
113+
114+
```bash
115+
pip install fastrag
116+
```
117+
118+
or from a local clone:
109119

110120
```bash
111121
pip install .
112122
```
113123

114-
There are several dependencies to consider, depending on your specific usage:
124+
There are several dependencies to consider, depending on your specific usage (also works with `pip install fastrag[*]` package):
115125

116126
```bash
117127
# Additional engines/components
@@ -122,9 +132,6 @@ pip install .[colbert] # Support for ColBERT+PLAID; requires FAISS
122132
pip install .[faiss-cpu] # CPU-based Faiss library
123133
pip install .[faiss-gpu] # GPU-based Faiss library
124134

125-
# Benchmarking
126-
pip install .[benchmark]
127-
128135
# Development tools
129136
pip install .[dev]
130137
```

benchmarks/README.md

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ We provide scripts for running some well known benchmarks with fastRAG. The goal
44

55
We report results as compared with the original benchmark papers.
66

7+
## Installation
8+
9+
Running the benchmarks require some additional packages:
10+
11+
``` sh
12+
pip install beir
13+
pip install git+https://github.com/facebookresearch/KILT.git
14+
```
15+
716
## :beers: BeIR Benchmark
817

918
[BeIR](https://github.com/beir-cellar/beir) contains diverse IR tasks ([Thakur et al. 2021](#org29ef2fc)); here we focus on MSMARCO and NaturalQuestions (NQ). For each task, we test two pipelines:

fastrag/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
### Essential imports for loading components and modifications to original Haystack components
22
from fastrag import generators, rankers, retrievers, stores
33

4-
__version__ = "3.0.0"
4+
__version__ = "3.0.1"

setup.cfg

-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
[options]
2-
packages = find:
3-
42
install_requires =
53
haystack-ai==2.1.2
64
transformers>=4.35.2
@@ -29,10 +27,6 @@ dev =
2927
pytest
3028
pre-commit
3129

32-
benchmark =
33-
beir
34-
kilt @ git+https://github.com/facebookresearch/KILT.git
35-
3630
elastic =
3731
elasticsearch-haystack
3832

setup.py

+14-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
import codecs
21
import os
32
import pathlib
43

5-
from setuptools import setup
4+
from setuptools import find_namespace_packages, find_packages, setup
65

76
here = pathlib.Path(__file__).parent.resolve()
87

98

109
def read(rel_path):
11-
with codecs.open(os.path.join(here, rel_path), "r") as fp:
10+
with open(os.path.join(here, rel_path), "r", encoding="utf-8") as fp:
1211
return fp.read()
1312

1413

@@ -21,15 +20,22 @@ def get_version(rel_path):
2120
raise RuntimeError("Unable to find version string.")
2221

2322

24-
# Get the long description from the README file
25-
long_description = (here / "README.md").read_text(encoding="utf-8")
26-
2723
setup(
2824
name="fastrag",
2925
author="Intel Labs",
3026
version=get_version("fastrag/__init__.py"),
31-
description="A research framework for building and evaluating neural information retrieval and generative models.",
32-
long_description=long_description,
27+
packages=find_namespace_packages(include=["fastrag*"]),
28+
description="An Efficient Retrieval Augmentation and Generation Framework for Intel Hardware.",
29+
long_description=read("README.md"),
3330
long_description_content_type="text/markdown",
31+
url="https://github.com/IntelLabs/fastRAG",
32+
license="Apache-2.0",
3433
python_requires=">=3.8, <4",
34+
classifiers=[
35+
"Programming Language :: Python :: 3",
36+
"License :: OSI Approved :: Apache Software License",
37+
"Operating System :: OS Independent",
38+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
39+
"Topic :: Software Development :: Libraries",
40+
],
3541
)

0 commit comments

Comments
 (0)