Spaces:
Sleeping
Sleeping
Update up_database.py
Browse files- up_database.py +3 -6
up_database.py
CHANGED
|
@@ -1,17 +1,17 @@
|
|
| 1 |
import re
|
| 2 |
import faiss
|
| 3 |
import numpy as np
|
| 4 |
-
from
|
| 5 |
from langchain_huggingface import HuggingFaceEmbeddings
|
| 6 |
from langchain_community.vectorstores import FAISS
|
| 7 |
from langchain_core.documents import Document
|
| 8 |
from pdfminer.high_level import extract_text
|
| 9 |
from up_config import Config
|
| 10 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 11 |
-
from
|
| 12 |
from langchain_core.output_parsers import StrOutputParser
|
| 13 |
from langchain_community.docstore.in_memory import InMemoryDocstore
|
| 14 |
-
# from langchain_ollama import ChatOllama
|
| 15 |
|
| 16 |
def document_description(text: str)->str:
|
| 17 |
|
|
@@ -106,7 +106,4 @@ def ingest_into_vector_db_hnsw(file_path: str):
|
|
| 106 |
}
|
| 107 |
)
|
| 108 |
|
| 109 |
-
# retriver = vectorstore.as_retriever()
|
| 110 |
-
|
| 111 |
-
# return retriever, doc_desc
|
| 112 |
return retriever, summ_docs
|
|
|
|
| 1 |
import re
|
| 2 |
import faiss
|
| 3 |
import numpy as np
|
| 4 |
+
from langchain.text_splitter import RecursiveCharacterTextSplitter
|
| 5 |
from langchain_huggingface import HuggingFaceEmbeddings
|
| 6 |
from langchain_community.vectorstores import FAISS
|
| 7 |
from langchain_core.documents import Document
|
| 8 |
from pdfminer.high_level import extract_text
|
| 9 |
from up_config import Config
|
| 10 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
| 11 |
+
from langchain.prompts import PromptTemplate
|
| 12 |
from langchain_core.output_parsers import StrOutputParser
|
| 13 |
from langchain_community.docstore.in_memory import InMemoryDocstore
|
| 14 |
+
# from langchain_ollama import ChatOllama
|
| 15 |
|
| 16 |
def document_description(text: str)->str:
|
| 17 |
|
|
|
|
| 106 |
}
|
| 107 |
)
|
| 108 |
|
|
|
|
|
|
|
|
|
|
| 109 |
return retriever, summ_docs
|