bug fixed

This commit is contained in:
timothyafolami
2024-08-07 18:55:56 +01:00
parent ab418262b1
commit 9a2a4c5fdd
4 changed files with 18 additions and 6 deletions
+1 -3
View File
@@ -1,8 +1,6 @@
from utils import create_vector_store, save_embedded_data, load_documents_from_directory, load_embedding_model
import sys, os
# Add the root directory to sys.path
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from data_ingestion.utils import create_vector_store, save_embedded_data, load_documents_from_directory, load_embedding_model
from loggings.logging_config import logger
+12
View File
@@ -38,3 +38,15 @@
2024-08-07 18:02:08,752 - INFO - Vector store created
2024-08-07 18:02:08,752 - INFO - Saving the vector store
2024-08-07 18:02:08,752 - INFO - Vector store saved
2024-08-07 18:32:03,492 - INFO - Loading the embeddings
2024-08-07 18:32:03,492 - INFO - Load pretrained SentenceTransformer: BAAI/bge-small-en
2024-08-07 18:32:07,243 - INFO - Embeddings loaded
2024-08-07 18:32:07,243 - INFO - Loading data from ./data
2024-08-07 18:42:08,987 - INFO - Loading the embeddings
2024-08-07 18:42:08,987 - INFO - Load pretrained SentenceTransformer: BAAI/bge-small-en
2024-08-07 18:42:58,926 - INFO - Loading the embeddings
2024-08-07 18:42:58,926 - INFO - Load pretrained SentenceTransformer: BAAI/bge-small-en
2024-08-07 18:43:25,721 - INFO - Embeddings loaded
2024-08-07 18:46:38,939 - INFO - Loading the embeddings
2024-08-07 18:46:38,939 - INFO - Load pretrained SentenceTransformer: BAAI/bge-small-en
2024-08-07 18:47:03,089 - INFO - Embeddings loaded
+5 -3
View File
@@ -1,4 +1,6 @@
# main.py
import sys, os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
@@ -33,7 +35,7 @@ app.add_middleware(
class SearchRequest(BaseModel):
query: str
@app.post("/load_documents")
@app.get("/load_documents")
def load_documents(directory: str):
global vector_store
@@ -42,7 +44,7 @@ def load_documents(directory: str):
return {"status": "Documents loaded successfully"}
@app.post("/search")
@app.get("/search")
def search(request: SearchRequest):
global vector_store