Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added badge push to Jenkins #74

Merged
merged 106 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
36ec9ca
mypy changes
sanchitvj Mar 31, 2024
0216f36
mypy modifications
sanchitvj Mar 31, 2024
33d553f
Jenkisfile, CI
sanchitvj Mar 31, 2024
24f22da
issue with ci
sanchitvj Mar 31, 2024
15e904f
jenkinsfile error
sanchitvj Mar 31, 2024
1b58f91
virtual environment issue
sanchitvj Mar 31, 2024
6eb78ee
grag installation
sanchitvj Mar 31, 2024
e683a1a
rewriting config.ini
sanchitvj Mar 31, 2024
8ad88fb
model path modified
sanchitvj Mar 31, 2024
c8e48e6
.
sanchitvj Mar 31, 2024
676169a
installations
sanchitvj Mar 31, 2024
88b3e60
.
sanchitvj Mar 31, 2024
43122a1
modified jenkisfile
sanchitvj Mar 31, 2024
c7be5f1
Jenkins declarative checkout
arjbingly Apr 1, 2024
0a3f43c
Unstructured deps
arjbingly Apr 1, 2024
749e02f
Declarative checkout scm
arjbingly Apr 1, 2024
ed5d893
Workspace cleanup
arjbingly Apr 1, 2024
d3611c4
Python env jenkins
arjbingly Apr 1, 2024
974a9fb
Python env jenkins
arjbingly Apr 1, 2024
076ebad
failing build because of environment
sanchitvj Apr 1, 2024
5d0caa4
.
sanchitvj Apr 1, 2024
1b6ebe6
.
sanchitvj Apr 1, 2024
06bb9e5
.
sanchitvj Apr 1, 2024
31ef1fb
.
sanchitvj Apr 1, 2024
75152d8
.
sanchitvj Apr 1, 2024
bc64eaa
.
sanchitvj Apr 1, 2024
aa63b16
changed environment, clean added
sanchitvj Apr 1, 2024
ce0fd6c
resolved multivector retriever, added chroma as docker to Jenkins
sanchitvj Apr 1, 2024
8011aba
excluded ci, and docs from ruff check
sanchitvj Apr 1, 2024
b597720
added .venv to exclude form ruff
sanchitvj Apr 1, 2024
6d7a5bc
.
sanchitvj Apr 1, 2024
c1e43db
.
sanchitvj Apr 1, 2024
4f45713
docker
sanchitvj Apr 1, 2024
ddcd752
-detach before -port
sanchitvj Apr 1, 2024
fcc4b68
toml issue
sanchitvj Apr 1, 2024
54d011e
.
sanchitvj Apr 1, 2024
c862020
.
sanchitvj Apr 1, 2024
7b63ef9
.
sanchitvj Apr 1, 2024
7fc8850
.
sanchitvj Apr 1, 2024
0f113cb
.
sanchitvj Apr 1, 2024
be1991c
.
sanchitvj Apr 1, 2024
7e60085
.
sanchitvj Apr 1, 2024
d4c3249
.
sanchitvj Apr 1, 2024
ca7be65
.
sanchitvj Apr 1, 2024
b0d0455
Jenkisfile, CI
sanchitvj Apr 1, 2024
a5952c3
Merge branch 'tests' of https://github.com/arjbingly/Capstone_5 into …
sanchitvj Apr 1, 2024
20c325d
Merge branch 'tests' of https://github.com/arjbingly/Capstone_5 into …
sanchitvj Apr 1, 2024
b350478
Jenkins pipeline working
sanchitvj Apr 1, 2024
bfa94ff
Merge branch 'tests' of https://github.com/arjbingly/Capstone_5 into …
sanchitvj Apr 1, 2024
6d599f1
Merge branch 'tests' of https://github.com/arjbingly/Capstone_5 into …
sanchitvj Apr 1, 2024
847c398
Merge branch 'tests' of https://github.com/arjbingly/Capstone_5 into …
sanchitvj Apr 1, 2024
6d641e9
Merge pull request #65 from arjbingly/tests
arjbingly Apr 1, 2024
ef2a8ad
modifying tests
sanchitvj Apr 2, 2024
e9a1900
added BLAS for jenkins
sanchitvj Apr 2, 2024
c39203b
adding BLAS
sanchitvj Apr 2, 2024
3e56298
adding CUDA path explicitly in environment
sanchitvj Apr 2, 2024
a6a6336
.env loading in config
sanchitvj Apr 2, 2024
8d2a2bb
.
sanchitvj Apr 2, 2024
ed18d76
removing load_dotenv
sanchitvj Apr 2, 2024
5057981
removing test data
sanchitvj Apr 3, 2024
4800b78
.
sanchitvj Apr 3, 2024
84675ad
.
sanchitvj Apr 3, 2024
cf233e7
.
sanchitvj Apr 3, 2024
b1a5da5
.
sanchitvj Apr 3, 2024
5dd4008
.
sanchitvj Apr 3, 2024
4ad2de8
.
sanchitvj Apr 3, 2024
fff42ab
.
sanchitvj Apr 3, 2024
18d87ba
.
sanchitvj Apr 3, 2024
8a5db2f
gemma issue
sanchitvj Apr 3, 2024
2d06bcd
,.
sanchitvj Apr 3, 2024
4b84206
.
sanchitvj Apr 3, 2024
ea0967b
.
sanchitvj Apr 3, 2024
2cbb470
.
sanchitvj Apr 3, 2024
6a58dc8
.
sanchitvj Apr 3, 2024
08e4b7d
/
sanchitvj Apr 3, 2024
4c40ca9
.
sanchitvj Apr 3, 2024
b916134
.
sanchitvj Apr 3, 2024
0ef41ae
token errors
sanchitvj Apr 3, 2024
2fb6683
.
sanchitvj Apr 3, 2024
e2bdb31
CUDA issue, token issue
sanchitvj Apr 3, 2024
2292c4b
.
sanchitvj Apr 3, 2024
3602673
.
sanchitvj Apr 3, 2024
81e7d9b
.
sanchitvj Apr 3, 2024
4b211ad
.
sanchitvj Apr 3, 2024
aba300e
.
sanchitvj Apr 3, 2024
e37ebff
.
sanchitvj Apr 3, 2024
71c34a9
.
sanchitvj Apr 3, 2024
2b0db0b
.
sanchitvj Apr 3, 2024
c543bd2
.
sanchitvj Apr 3, 2024
dba7428
Final build
sanchitvj Apr 3, 2024
7324f5e
.
sanchitvj Apr 3, 2024
b478ecb
FInal build
sanchitvj Apr 4, 2024
f17b032
making sure to clear CUDA
sanchitvj Apr 4, 2024
1fa9624
deleting client
sanchitvj Apr 4, 2024
2fe007a
Jenkins Pipeline
arjbingly Apr 4, 2024
a646253
Merge branch 'tests' of https://github.com/arjbingly/Capstone_5 into …
arjbingly Apr 4, 2024
73af8cd
Merge pull request #66 from arjbingly/tests
sanchitvj Apr 4, 2024
1236092
Merge branch 'main' of https://github.com/arjbingly/Capstone_5
sanchitvj Apr 4, 2024
d1e099f
Merge branch 'main' of https://github.com/arjbingly/Capstone_5
sanchitvj Apr 4, 2024
aadd13b
added typing in LLM class
sanchitvj Apr 6, 2024
02d4542
adding async ingest
sanchitvj Apr 7, 2024
e0f51a7
corrected typing
sanchitvj Apr 8, 2024
4983c31
Merge branch 'project-BasicRAG' of https://github.com/arjbingly/Capst…
sanchitvj Apr 8, 2024
602e959
added async to cookbook
sanchitvj Apr 12, 2024
e3b35e6
added testing badge update script
sanchitvj Apr 12, 2024
6f983e0
added badge modification
sanchitvj Apr 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 25 additions & 11 deletions ci/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pipeline {
stage('Create venv'){
steps {
sh 'python3 -m venv .venv'
sh 'exit 1'
}
}

Expand Down Expand Up @@ -80,7 +81,6 @@ pipeline {
withChecks('Static Type Checks'){
junit 'mypy-report.xml'
}

}
}
}
Expand All @@ -102,18 +102,32 @@ pipeline {
withChecks('Integration Tests'){
junit 'pytest-report.xml'
}

cleanWs(
cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']]
)
}
}
}

}
post {
failure{
sh 'python3 ci/modify_test_status.py --fail'
sh 'git add README.md'
sh 'git commit -m "test status updated"'
sh 'git push'
}
success{
sh 'python3 ci/modify_test_status.py'
sh 'git add README.md'
sh 'git commit -m "test status updated"'
sh 'git push'
}
cleanup{
cleanWs(
cleanWhenNotBuilt: false,
deleteDirs: true,
disableDeferredWipeout: true,
notFailBuild: true,
patterns: [[pattern: '.gitignore', type: 'INCLUDE'],
[pattern: '.propsfile', type: 'EXCLUDE']]
)
}
}
}
22 changes: 22 additions & 0 deletions ci/modify_test_status.py
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)
10 changes: 9 additions & 1 deletion cookbook/Basic-RAG/BasicRAG_ingest.py
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))
32 changes: 17 additions & 15 deletions src/grag/components/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
from pathlib import Path
from typing import Optional, Union

import torch
from langchain.callbacks.manager import CallbackManager
Expand Down Expand Up @@ -38,18 +39,18 @@ class LLM:

def __init__(
self,
model_name=llm_conf["model_name"],
device_map=llm_conf["device_map"],
task=llm_conf["task"],
max_new_tokens=llm_conf["max_new_tokens"],
temperature=llm_conf["temperature"],
n_batch=llm_conf["n_batch_gpu_cpp"],
n_ctx=llm_conf["n_ctx_cpp"],
n_gpu_layers=llm_conf["n_gpu_layers_cpp"],
std_out=llm_conf["std_out"],
base_dir=llm_conf["base_dir"],
quantization=llm_conf["quantization"],
pipeline=llm_conf["pipeline"],
model_name: str = llm_conf["model_name"],
device_map: str = llm_conf["device_map"],
task: str = llm_conf["task"],
max_new_tokens: str = llm_conf["max_new_tokens"],
temperature: str = llm_conf["temperature"],
n_batch: str = llm_conf["n_batch_gpu_cpp"],
n_ctx: str = llm_conf["n_ctx_cpp"],
n_gpu_layers: str = llm_conf["n_gpu_layers_cpp"],
std_out: Union[bool, str] = llm_conf["std_out"],
base_dir: str = llm_conf["base_dir"],
quantization: str = llm_conf["quantization"],
pipeline: str = llm_conf["pipeline"],
):
"""Initialize the LLM class using the given parameters."""
self.base_dir = Path(base_dir)
Expand All @@ -66,7 +67,7 @@ def __init__(
if std_out:
self.callback_manager = CallbackManager([StreamingStdOutCallbackHandler()])
else:
self.callback_manager = None
self.callback_manager = None # type: ignore

@property
def model_name(self):
Expand All @@ -85,7 +86,7 @@ def model_path(self):
self.base_dir / self.model_name / f"ggml-model-{self.quantization}.gguf"
)

def hf_pipeline(self, is_local=False):
def hf_pipeline(self, is_local: Optional[bool] = False):
"""Loads the model using Hugging Face transformers.

Args:
Expand Down Expand Up @@ -161,7 +162,8 @@ def llama_cpp(self):
return llm

def load_model(
self, model_name=None, pipeline=None, quantization=None, is_local=None
self, model_name: Optional[str] = None, pipeline: Optional[str] = None, quantization: Optional[str] = None,
is_local: Optional[bool] = None
):
"""Loads the model based on the specified pipeline and model name.

Expand Down