Skip to content

Commit 0b25ece

Browse files
resolved segmentation fault error in chatbot (#245)
1 parent 48f1bf3 commit 0b25ece

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

deploy/k8s/base/chatbot/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ spec:
1111
metadata:
1212
labels:
1313
app: crapi-chatbot
14+
spec:
1415
containers:
1516
- name: crapi-chatbot
1617
image: crapi/crapi-chatbot:latest

deploy/k8s/base/deploy.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ kubectl apply -n crapi -f ./identity
1212
kubectl apply -n crapi -f ./community
1313
kubectl apply -n crapi -f ./workshop
1414
kubectl apply -n crapi -f ./web
15+
kubectl apply -n crapi -f ./chatbot

services/chatbot/src/chatbot_api.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ def document_loader():
3737
loader_cls=UnstructuredMarkdownLoader,
3838
)
3939
documents = loader.load()
40-
app.logger.debug("Loaded %s documents", len(documents))
40+
app.logger.debug("Loaded %s documents in db", len(documents))
4141
text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=100)
4242
texts = text_splitter.split_documents(documents)
4343
embeddings = get_embeddings()
44-
os.system("rm -rf ./db")
4544
db = Chroma.from_documents(texts, embeddings, persist_directory="./db")
4645
db.persist()
4746
retriever = db.as_retriever(search_kwargs={"k": target_source_chunks})

0 commit comments

Comments
 (0)