Skip to content

Commit

Permalink
pypi new version
Browse files Browse the repository at this point in the history
Signed-off-by: samadpls <[email protected]>
  • Loading branch information
samadpls committed Nov 7, 2024
1 parent 7979f6d commit 622f6e2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@

<img src="https://github.com/user-attachments/assets/e23d11d5-2d7b-44e2-aa11-59ddcb66bebc" align=left height=150px>

![Supported python versions](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)
[![PEP8](https://img.shields.io/badge/code%20style-pep8-black.svg)](https://www.python.org/dev/peps/pep-0008/)
[![License](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](LICENSE)
[![Run Pytest](https://github.com/samadpls/BestRAG/actions/workflows/pytest.yml/badge.svg?branch=main)](https://github.com/samadpls/BestRAG/actions/workflows/pytest.yml)
<img src='https://img.shields.io/github/stars/samadpls/BestRAG?color=red&label=stars&logoColor=black&style=social'>
![GitHub stars](https://img.shields.io/github/stars/samadpls/BestRAG?color=red&label=stars&logoColor=black&style=social)


Welcome to **BestRAG**! This Python library enables you to efficiently store and retrieve embeddings using a hybrid Retrieval-Augmented Generation (RAG) approach. It combines dense, sparse, and late interaction embeddings to provide a robust solution for handling large datasets.

---

## 🚀 Installation

To install **BestRAG**, simply run:
Expand Down Expand Up @@ -54,4 +59,4 @@ This project is licensed under the [MIT License](LICENSE).

---

Created by [samadpls](https://github.com/samadpls) 🎉
Created by [samadpls](https://github.com/samadpls) 🎉
13 changes: 7 additions & 6 deletions bestrag/best_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class BestRAG:
interaction model to use. Defaults to "BAAI/bge-small-en-v1.5".
"""

def __init__(self,
url: str,
api_key: str,
collection_name: str,
def __init__(self,
url: str,
api_key: str,
collection_name: str,
late_interaction_model_name: Optional[str] = "BAAI/bge-small-en-v1.5"
):
self.collection_name = collection_name
Expand All @@ -57,9 +57,9 @@ def _create_or_use_collection(self):
collection_name=self.collection_name,
vectors_config={
"dense-vector": models.VectorParams(
size=384,
size=384,
distance=Distance.COSINE
),
),
"output-token-embeddings": models.VectorParams(
size=384,
distance=Distance.COSINE,
Expand Down Expand Up @@ -180,6 +180,7 @@ def store_pdf_embeddings(self, pdf_path: str):
collection_name=self.collection_name,
points=[point]
)

print(
f"Stored embedding for page {page_num + 1} in collection '{self.collection_name}'.")

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@

setup(
name="bestrag",
version="0.1.3",
version="0.2.0",
description="BestRAG (Best Retrieval Augmented) is a library for storing and"
" searching document embeddings in a Qdrant vector database. It uses a "
"hybrid embedding technique combining dense, late interaction and sparse representations for better performance.",
author="samadpls",
author_email="[email protected]",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/samadpls/bestrag",
url="https://github.com/samadpls/bestRAG",
packages=find_packages(),
install_requires=[
"fastembed==0.4.1",
Expand Down

0 comments on commit 622f6e2

Please sign in to comment.