Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -31,12 +31,12 @@ from langchain_community.embeddings import HuggingFaceEmbeddings
|
|
31 |
from langchain_community.llms import HuggingFacePipeline
|
32 |
|
33 |
# Get secret keys.
|
34 |
-
os.environ["OPENAI_API_KEY"] =
|
35 |
-
os.environ["MONGO_URI"] =
|
36 |
|
37 |
# Retrieve environment variables.
|
38 |
-
|
39 |
-
|
40 |
|
41 |
# Append our directory path to the Python system path.
|
42 |
directory_path = "Syllaby"
|
@@ -51,7 +51,7 @@ my_pdfs = os.listdir(directory_path)
|
|
51 |
my_pdfs
|
52 |
|
53 |
# Connect to MongoDB Atlas cluster using the connection string.
|
54 |
-
cluster = MongoClient(
|
55 |
|
56 |
# Define the MongoDB database and collection name.
|
57 |
DB_NAME = "pdfs"
|
|
|
31 |
from langchain_community.llms import HuggingFacePipeline
|
32 |
|
33 |
# Get secret keys.
|
34 |
+
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY
|
35 |
+
os.environ["MONGO_URI"] = MONGO_URI
|
36 |
|
37 |
# Retrieve environment variables.
|
38 |
+
OPENAI_API_KEYY = os.getenv('OPENAI_API_KEY')
|
39 |
+
MONGO_URII = os.getenv('MONGO_URI')
|
40 |
|
41 |
# Append our directory path to the Python system path.
|
42 |
directory_path = "Syllaby"
|
|
|
51 |
my_pdfs
|
52 |
|
53 |
# Connect to MongoDB Atlas cluster using the connection string.
|
54 |
+
cluster = MongoClient(MONGO_URII)
|
55 |
|
56 |
# Define the MongoDB database and collection name.
|
57 |
DB_NAME = "pdfs"
|