Skip to content

Commit

Permalink
fix cache dir
Browse files Browse the repository at this point in the history
  • Loading branch information
dayesouza committed Mar 26, 2024
1 parent 039f40d commit 98dc323
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 174 deletions.
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ ENV IS_DOCKER True

# Install dependencies
WORKDIR ./
COPY . .
COPY ./app ./app
COPY ./.streamlit ./.streamlit
COPY Dockerfile .
COPY requirements.txt .
RUN pip install -r requirements.txt

# Run application
Expand Down
166 changes: 0 additions & 166 deletions app/util/notebook_embedder.ipynb

This file was deleted.

3 changes: 2 additions & 1 deletion app/workflows/question_answering/classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
import tiktoken
import scipy.spatial.distance
import workflows.question_answering.config as config
import os


import util.Embedder

embedder = util.Embedder.create_embedder(cache=f'{config.cache_dir}\\qa_mine') #SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
embedder = util.Embedder.create_embedder(cache=os.path.join(config.cache_dir,"qa_mine")) #SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
encoder = tiktoken.get_encoding('cl100k_base')

class Question:
Expand Down
4 changes: 3 additions & 1 deletion app/workflows/question_answering/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
cache_dir = '.\\cache\\question_answering'
import os

cache_dir = os.path.join(os.environ.get("CACHE_DIR", "cache"), "question_answering")

chunk_size = 5000
chunk_overlap = 0
Expand Down
2 changes: 1 addition & 1 deletion app/workflows/question_answering/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import workflows.question_answering.classes as classes
import workflows.question_answering.config as config

embedder = util.Embedder.create_embedder(cache=f'{config.cache_dir}\qa_mine')
embedder = util.Embedder.create_embedder(cache=f'{config.cache_dir}/qa_mine')
encoder = tiktoken.get_encoding('cl100k_base')


Expand Down
6 changes: 4 additions & 2 deletions app/workflows/record_matching/config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import os

att_val_sep = '=='
list_sep = '; '
max_rows_to_show = 1000
entity_label = 'Entity'
cache_dir = '.\\cache\\record_matching'
outputs_dir = f'{cache_dir}\\outputs'
cache_dir = os.path.join(os.environ.get("CACHE_DIR", "cache"), "record_matching")
outputs_dir = os.path.join(cache_dir,"outputs")

intro = """ \
# Record Matching
Expand Down
5 changes: 3 additions & 2 deletions app/workflows/risk_networks/config.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import os
att_val_sep = '=='
list_sep = '; '
max_rows_to_show = 1000
entity_label = 'ENTITY'
cache_dir = '.\\cache\\risk_networks'
outputs_dir = f'{cache_dir}\\outputs'
cache_dir = os.path.join(os.environ.get("CACHE_DIR", "cache"), "risk_networks")
outputs_dir = os.path.join(cache_dir, "outputs")

intro = """ \
# Risk Networks
Expand Down

0 comments on commit 98dc323

Please sign in to comment.