delphiclinic commited on
Commit
ddba56a
β€’
1 Parent(s): 54444c8

Update app.py

Browse files

Uncommenting data embedding stage

Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -22,8 +22,8 @@ import os
22
  huggingfacehub_api_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
23
 
24
 
25
- # loader = PyPDFLoader("data/stg.pdf")
26
- # documents = loader.load_and_split()
27
 
28
 
29
 
@@ -36,11 +36,11 @@ model_norm = HuggingFaceBgeEmbeddings(
36
  model_kwargs={'device': 'cpu'},
37
  encode_kwargs=encode_kwargs
38
  )
39
- # vector_store = FAISS.from_documents(documents, model_norm)
40
  # job_done = object() # signals the processing is done
41
 
42
  ## saving the embeddings locally
43
- # vector_store.save_local("cdssagent_database")
44
 
45
  ##loading
46
  vector_store = FAISS.load_local("cdssagent_database", model_norm, allow_dangerous_deserialization=True)
 
22
  huggingfacehub_api_token = os.getenv("HUGGINGFACEHUB_API_TOKEN")
23
 
24
 
25
+ loader = PyPDFLoader("stg.pdf")
26
+ documents = loader.load_and_split()
27
 
28
 
29
 
 
36
  model_kwargs={'device': 'cpu'},
37
  encode_kwargs=encode_kwargs
38
  )
39
+ vector_store = FAISS.from_documents(documents, model_norm)
40
  # job_done = object() # signals the processing is done
41
 
42
  ## saving the embeddings locally
43
+ vector_store.save_local("cdssagent_database")
44
 
45
  ##loading
46
  vector_store = FAISS.load_local("cdssagent_database", model_norm, allow_dangerous_deserialization=True)