tech5 commited on
Commit
6048b8c
·
1 Parent(s): d23147d

Copied GitHub project to Hugging Face Space

Browse files
backend/api/main.py CHANGED
@@ -26,7 +26,7 @@ async def root():
26
  @app.post("/upload/")
27
  async def upload_pdfs(user_id: str = Form(...), files: List[UploadFile] = File(...)):
28
  # Create directories for the user
29
- base_dir = os.path.join("docs", user_id)
30
  pdf_dir = os.path.join(base_dir, "pdfs")
31
  image_dir = os.path.join(base_dir,"images")
32
  faiss_dir = os.path.join(base_dir, "faiss_index")
 
26
  @app.post("/upload/")
27
  async def upload_pdfs(user_id: str = Form(...), files: List[UploadFile] = File(...)):
28
  # Create directories for the user
29
+ base_dir = os.path.join("/tmp/docs", user_id)
30
  pdf_dir = os.path.join(base_dir, "pdfs")
31
  image_dir = os.path.join(base_dir,"images")
32
  faiss_dir = os.path.join(base_dir, "faiss_index")
backend/models/app.py CHANGED
@@ -14,7 +14,7 @@ llm = ChatGroq(model='llama-3.3-70b-versatile')
14
 
15
  #Funtion for load Vector data
16
  def load_user_vectorstore(user_id: str):
17
- faiss_path = os.path.join("docs", user_id, "faiss_index")
18
  if not os.path.exists(faiss_path):
19
  raise ValueError(f"No FAISS index found for user '{user_id}'")
20
 
 
14
 
15
  #Funtion for load Vector data
16
  def load_user_vectorstore(user_id: str):
17
+ faiss_path = os.path.join("/tmp/docs", user_id, "faiss_index")
18
  if not os.path.exists(faiss_path):
19
  raise ValueError(f"No FAISS index found for user '{user_id}'")
20
 
backend/models/embed.py CHANGED
@@ -12,7 +12,7 @@ import pytesseract
12
  # Funtion for load Documents and Save it into Vector Stores
13
  def embed_and_store(user_id: str):
14
  # Setup user directories
15
- base_dir = os.path.join("docs", user_id)
16
  pdf_dir = os.path.join(base_dir, "pdfs")
17
  image_dir = os.path.join(base_dir,"images")
18
  faiss_dir = os.path.join(base_dir, "faiss_index")
 
12
  # Funtion for load Documents and Save it into Vector Stores
13
  def embed_and_store(user_id: str):
14
  # Setup user directories
15
+ base_dir = os.path.join("/tmp/docs", user_id)
16
  pdf_dir = os.path.join(base_dir, "pdfs")
17
  image_dir = os.path.join(base_dir,"images")
18
  faiss_dir = os.path.join(base_dir, "faiss_index")