Spaces:
Runtime error
Runtime error
imported needed imports
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ from langchain.chains import RetrievalQA
|
|
18 |
|
19 |
from langchain.prompts import ChatPromptTemplate
|
20 |
|
21 |
-
from utils import download_from_google_drive
|
22 |
|
23 |
from dotenv import load_dotenv
|
24 |
|
@@ -41,10 +41,13 @@ print(file_id)
|
|
41 |
# file_id = os.getenv(gdown_file_id) # Replace with your file ID
|
42 |
download_from_google_drive(file_id)
|
43 |
zip_file_path = "/content/chroma_db-complete.zip" # Replace with your zip file path
|
44 |
-
extract_path = "/
|
|
|
|
|
|
|
45 |
unzip_file(zip_file_path,extract_path)
|
46 |
|
47 |
-
db = Chroma(persist_directory=
|
48 |
db.get()
|
49 |
#texts = text_splitter.split_documents(documents)
|
50 |
#db = Chroma.from_documents(texts, embedding_function=embeddings)
|
|
|
18 |
|
19 |
from langchain.prompts import ChatPromptTemplate
|
20 |
|
21 |
+
from utils import download_from_google_drive, unzip_file
|
22 |
|
23 |
from dotenv import load_dotenv
|
24 |
|
|
|
41 |
# file_id = os.getenv(gdown_file_id) # Replace with your file ID
|
42 |
download_from_google_drive(file_id)
|
43 |
zip_file_path = "/content/chroma_db-complete.zip" # Replace with your zip file path
|
44 |
+
extract_path = "/gdown_chroma_db"
|
45 |
+
|
46 |
+
embedding_db_location = "/gdown_chroma_db"
|
47 |
+
|
48 |
unzip_file(zip_file_path,extract_path)
|
49 |
|
50 |
+
db = Chroma(persist_directory=embedding_db_location, embedding_function=embeddings)
|
51 |
db.get()
|
52 |
#texts = text_splitter.split_documents(documents)
|
53 |
#db = Chroma.from_documents(texts, embedding_function=embeddings)
|