Spaces:
Sleeping
Sleeping
SHAMIL SHAHBAZ AWAN
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,7 +6,7 @@ import faiss
|
|
| 6 |
import numpy as np
|
| 7 |
from groq import Client
|
| 8 |
|
| 9 |
-
# Set background image
|
| 10 |
background_image_url = "https://jamesclear.com/wp-content/uploads/2020/11/atomic-habits_gallery_hi-res_01.jpg"
|
| 11 |
st.markdown(
|
| 12 |
f"""
|
|
@@ -17,8 +17,8 @@ st.markdown(
|
|
| 17 |
background-position: center center;
|
| 18 |
background-repeat: no-repeat;
|
| 19 |
}}
|
| 20 |
-
h1 {{
|
| 21 |
-
color: black;
|
| 22 |
}}
|
| 23 |
.footer {{
|
| 24 |
position: fixed;
|
|
@@ -49,14 +49,14 @@ embedder = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
|
| 49 |
|
| 50 |
# Define file path and vector store folder
|
| 51 |
file_path = "Atomic habits ( PDFDrive ).pdf" # File directly in the root directory of the app
|
| 52 |
-
VECTORSTORE_FOLDER = "vectorstore
|
| 53 |
|
| 54 |
# Ensure the vector store folder exists
|
| 55 |
if not os.path.exists(VECTORSTORE_FOLDER):
|
| 56 |
os.makedirs(VECTORSTORE_FOLDER)
|
| 57 |
|
| 58 |
# Define the vector store path
|
| 59 |
-
vectorstore_path = os.path.join(VECTORSTORE_FOLDER, "index.faiss")
|
| 60 |
|
| 61 |
# Load or create FAISS index
|
| 62 |
if os.path.exists(vectorstore_path):
|
|
|
|
| 6 |
import numpy as np
|
| 7 |
from groq import Client
|
| 8 |
|
| 9 |
+
# Set background image and text color
|
| 10 |
background_image_url = "https://jamesclear.com/wp-content/uploads/2020/11/atomic-habits_gallery_hi-res_01.jpg"
|
| 11 |
st.markdown(
|
| 12 |
f"""
|
|
|
|
| 17 |
background-position: center center;
|
| 18 |
background-repeat: no-repeat;
|
| 19 |
}}
|
| 20 |
+
h1, h2, h3, h4, h5, h6, p {{
|
| 21 |
+
color: black; /* Set text color to black */
|
| 22 |
}}
|
| 23 |
.footer {{
|
| 24 |
position: fixed;
|
|
|
|
| 49 |
|
| 50 |
# Define file path and vector store folder
|
| 51 |
file_path = "Atomic habits ( PDFDrive ).pdf" # File directly in the root directory of the app
|
| 52 |
+
VECTORSTORE_FOLDER = "vectorstore" # Folder where the FAISS index will be stored
|
| 53 |
|
| 54 |
# Ensure the vector store folder exists
|
| 55 |
if not os.path.exists(VECTORSTORE_FOLDER):
|
| 56 |
os.makedirs(VECTORSTORE_FOLDER)
|
| 57 |
|
| 58 |
# Define the vector store path
|
| 59 |
+
vectorstore_path = os.path.join(VECTORSTORE_FOLDER, "index.faiss") # Correct path to the index file
|
| 60 |
|
| 61 |
# Load or create FAISS index
|
| 62 |
if os.path.exists(vectorstore_path):
|