luanpoppe commited on
Commit
e79797a
·
1 Parent(s): 68d3cc8
Files changed (2) hide show
  1. compose.yaml +10 -19
  2. langchain_backend/utils.py +3 -3
compose.yaml CHANGED
@@ -7,25 +7,16 @@ services:
7
  - SECRET_KEY=${SECRET_KEY}
8
  - DATABASE_PASSWORD=${DATABASE_PASSWORD}
9
  - OPENAI_API_KEY=${OPENAI_API_KEY}
10
- # - PYTHONPATH=/app:$PYTHONPATH
11
  env_file:
12
  - .env
13
- volumes:
14
- - type: bind
15
- source: .venv
16
- target: /app/.venv
17
- # target: /usr/lib/python3.12/site-packages
 
 
 
 
18
  volumes:
19
- myapp:
20
- # watch:
21
- # develop:
22
- # watch:
23
- # - action: sync
24
- # path: ./
25
- # target: /app
26
- # ignore:
27
- # - .venv/
28
- # - action: rebuild
29
- # path: requirements.txt
30
- # - action: rebuild
31
- # path: .venv/
 
7
  - SECRET_KEY=${SECRET_KEY}
8
  - DATABASE_PASSWORD=${DATABASE_PASSWORD}
9
  - OPENAI_API_KEY=${OPENAI_API_KEY}
 
10
  env_file:
11
  - .env
12
+ develop:
13
+ watch:
14
+ - action: sync
15
+ path: ./
16
+ target: /app
17
+ ignore:
18
+ - .venv/
19
+ - action: rebuild
20
+ path: requirements.txt
21
  volumes:
22
+ myapp:
 
 
 
 
 
 
 
 
 
 
 
 
langchain_backend/utils.py CHANGED
@@ -12,7 +12,7 @@ from setup.environment import default_model
12
  os.environ.get("OPENAI_API_KEY")
13
  os.environ.get("HUGGINGFACEHUB_API_TOKEN")
14
 
15
- def getPDF(file_path="./nike.pdf"):
16
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
17
  loader = PyPDFLoader(file_path, extract_images=False)
18
  pages = loader.load_and_split(text_splitter)
@@ -25,8 +25,8 @@ def create_retriever(documents):
25
  )
26
 
27
  retriever = vectorstore.as_retriever(
28
- search_type="similarity",
29
- search_kwargs={"k": 1},
30
  )
31
 
32
  return retriever
 
12
  os.environ.get("OPENAI_API_KEY")
13
  os.environ.get("HUGGINGFACEHUB_API_TOKEN")
14
 
15
+ def getPDF(file_path):
16
  text_splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
17
  loader = PyPDFLoader(file_path, extract_images=False)
18
  pages = loader.load_and_split(text_splitter)
 
25
  )
26
 
27
  retriever = vectorstore.as_retriever(
28
+ # search_type="similarity",
29
+ # search_kwargs={"k": 3},
30
  )
31
 
32
  return retriever