updated env var
Browse files- embed_with_db.py +9 -2
embed_with_db.py
CHANGED
|
@@ -5,8 +5,15 @@ from langchain_core.runnables import RunnablePassthrough
|
|
| 5 |
from langchain_core.output_parsers import StrOutputParser
|
| 6 |
from langchain.prompts import ChatPromptTemplate
|
| 7 |
from langchain_community.llms import HuggingFaceEndpoint
|
| 8 |
-
from
|
| 9 |
-
config=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
client = MongoClient(config['MONGODB_CONN_STRING'])
|
| 11 |
embeddings = HuggingFaceEmbeddings(model_name= "intfloat/e5-large-v2")
|
| 12 |
|
|
|
|
| 5 |
from langchain_core.output_parsers import StrOutputParser
|
| 6 |
from langchain.prompts import ChatPromptTemplate
|
| 7 |
from langchain_community.llms import HuggingFaceEndpoint
|
| 8 |
+
from os
|
| 9 |
+
config= {
|
| 10 |
+
'MONGODB_CONN_STRING': os.getenv('MONGODB_CONN_STRING'),
|
| 11 |
+
'HUGGINGFACEHUB_API_TOKEN': os.getenv('HUGGINGFACEHUB_API_TOKEN'),
|
| 12 |
+
'DB_NAME':os.getenv('DB_NAME'),
|
| 13 |
+
'VECTOR_SEARCH_INDEX':os.getenv('VECTOR_SEARCH_INDEX'),
|
| 14 |
+
'PASSWORD_DB': os.getenv('PASSWORD_DB')
|
| 15 |
+
|
| 16 |
+
}
|
| 17 |
client = MongoClient(config['MONGODB_CONN_STRING'])
|
| 18 |
embeddings = HuggingFaceEmbeddings(model_name= "intfloat/e5-large-v2")
|
| 19 |
|