-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #74 from arjbingly/project-BasicRAG
Added badge push to Jenkins
- Loading branch information
Showing
3 changed files
with
48 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import argparse | ||
|
||
if __name__ == '__main__': | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument('-f', '--fail', action='store_true') | ||
args = parser.parse_args() | ||
readme_path = 'README.md' # Path to your README file | ||
|
||
with open(readme_path, 'r') as file: | ||
lines = file.readlines() | ||
|
||
for i, line in enumerate(lines): | ||
if 'img.shields.io' in line and ('passing' in line or 'failing' in line): | ||
if args.f: | ||
lines[i] = line.replace('passing', 'failing').replace('darggreen', 'red') | ||
else: | ||
lines[i] = line.replace('failing', 'passing').replace('red', 'darggreen') | ||
print('README file has been updated.') | ||
|
||
with open(readme_path, 'w') as file: | ||
file.writelines(lines) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,23 @@ | ||
"""A cookbook demonstrating how to ingest pdf files for use with Basic RAG.""" | ||
|
||
import asyncio | ||
from pathlib import Path | ||
|
||
from grag.components.multivec_retriever import Retriever | ||
from grag.components.vectordb.deeplake_client import DeepLakeClient | ||
|
||
# from grag.components.vectordb.chroma_client import ChromaClient | ||
|
||
SYNC = True # Run synchronously (slow) | ||
ASYNC = True # Run asynchronously | ||
|
||
client = DeepLakeClient(collection_name="ci_test") | ||
# client = ChromaClient(collection_name="ci_test") | ||
retriever = Retriever(vectordb=client) | ||
|
||
dir_path = Path(__file__).parents[2] / "data/test/pdfs/new_papers" | ||
retriever.ingest(dir_path) | ||
|
||
if SYNC: | ||
retriever.ingest(dir_path) | ||
elif ASYNC: | ||
asyncio.run(retriever.aingest(dir_path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters