thumbnails generation added

This commit is contained in:
timothyafolami
2024-08-16 17:50:51 +01:00
parent cff9511d86
commit 83ecbded4b
+3 -1
View File
@@ -4,7 +4,7 @@ sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from fastapi import FastAPI, HTTPException from fastapi import FastAPI, HTTPException
from fastapi.middleware.cors import CORSMiddleware from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel from pydantic import BaseModel
from utils import load_embedded_data, load_documents_from_directory, create_vector_store, save_embedded_data from utils import load_embedded_data, load_documents_from_directory, create_vector_store, save_embedded_data, process_directory
from search import search_and_summarize from search import search_and_summarize
from data_ingest import load_data from data_ingest import load_data
@@ -40,6 +40,8 @@ def load_documents(directory: str):
embed_db = create_vector_store(documents, docs_id, num_pages) embed_db = create_vector_store(documents, docs_id, num_pages)
# saving the embedded data # saving the embedded data
status = save_embedded_data(embed_db) status = save_embedded_data(embed_db)
# creating the thumbnails
status = process_directory(directory)
return {"status": "Documents loaded successfully"} return {"status": "Documents loaded successfully"}