-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhancements & Refactored Code (#10)
* Fix: Button loading state not reset on 'back' * Feat: search post processing to filter by average score * Feat: Updated api status error handling * Feat: Updated error handling & timeout duration * Refactored imports & moved global vars to constants.py * Feat: Updated dockerfile to install llama-cpp-python with openblas support by default * Add .env file and update gitignore, pipeline name, robots.txt, middleware, layout, page, sitemap, and navlink components * Fixed Pipeline Name * Updated Check File Size workflow
- Loading branch information
Showing
27 changed files
with
539 additions
and
221 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 |
---|---|---|
|
@@ -12,6 +12,8 @@ jobs: | |
check-file-size: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Check large files | ||
uses: ppremk/[email protected] | ||
with: | ||
|
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
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
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,2 +1,3 @@ | ||
__pycache__ | ||
storage | ||
.env |
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
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
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
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,39 @@ | ||
######################################################################## | ||
# Model Constants for the backend app # | ||
######################################################################## | ||
from pathlib import Path | ||
|
||
from torch.cuda import is_available as is_cuda_available | ||
|
||
# Model Constants | ||
MAX_NEW_TOKENS = 4096 | ||
CONTEXT_SIZE = MAX_NEW_TOKENS | ||
DEVICE_TYPE = "cuda" if is_cuda_available() else "cpu" | ||
|
||
# Get the current directory | ||
CUR_DIR = Path.cwd() | ||
|
||
STORAGE_DIR = str(CUR_DIR / "storage") # directory to cache the generated index | ||
DATA_DIR = str(CUR_DIR / "data") # directory containing the documents to index | ||
|
||
# LLM Model Constants | ||
LLM_MODEL_URL = "https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q4_K_M.gguf" | ||
# Model Kwargs | ||
# set to at least 1 to use GPU, adjust according to your GPU memory, but must be able to fit the model | ||
MODEL_KWARGS = {"n_gpu_layers": 100} if DEVICE_TYPE == "cuda" else {} | ||
|
||
# Service Context Constants | ||
CHUNK_SIZE = 1000 | ||
CHUNK_OVERLAP = 100 | ||
|
||
# Embedding Model Constants | ||
EMBED_MODEL_NAME = "sentence-transformers/all-MiniLM-L6-v2" | ||
EMBED_POOLING = "mean" | ||
|
||
# Prompt Helper Constants | ||
# set maximum input size | ||
CHUNK_SIZE_LIMIT = MAX_NEW_TOKENS | ||
# set number of output tokens | ||
NUM_OUTPUT = 256 | ||
# set maximum chunk overlap | ||
CHUNK_OVERLAP_RATIO = 0.2 |
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
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
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 @@ | ||
ALLOWED_ORIGINS=http://localhost:3000 |
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
Oops, something went wrong.