Spaces:
Sleeping
Sleeping
Aiswarya Sankar
commited on
Commit
·
3e17bb4
1
Parent(s):
f1e7577
Migrate to a managed db
Browse files
app.py
CHANGED
@@ -120,7 +120,9 @@ def index_repo(textbox: str, dropdown: str) -> Response:
|
|
120 |
embedding_function=embeddings,
|
121 |
token=os.environ['ACTIVELOOP_TOKEN'],
|
122 |
read_only=True,
|
123 |
-
num_workers=
|
|
|
|
|
124 |
# NOTE: read_only=False because we want to ingest documents
|
125 |
# NOTE: This will raise a `deeplake.util.exceptions.LockedException` if dataset is already locked
|
126 |
# NOTE: change it to read_only=True when querying the dataset
|
@@ -149,7 +151,10 @@ def index_repo(textbox: str, dropdown: str) -> Response:
|
|
149 |
db = DeepLake(dataset_path=dataset_path,
|
150 |
embedding_function=embeddings,
|
151 |
token=os.environ['ACTIVELOOP_TOKEN'],
|
152 |
-
read_only=False
|
|
|
|
|
|
|
153 |
# Do this in chunks to avoid hitting the ratelimit immediately
|
154 |
for i in range(0, len(texts), 500):
|
155 |
print("Adding documents " + str(i))
|
|
|
120 |
embedding_function=embeddings,
|
121 |
token=os.environ['ACTIVELOOP_TOKEN'],
|
122 |
read_only=True,
|
123 |
+
num_workers=12,
|
124 |
+
runtime = {"tensor_db": True}
|
125 |
+
)
|
126 |
# NOTE: read_only=False because we want to ingest documents
|
127 |
# NOTE: This will raise a `deeplake.util.exceptions.LockedException` if dataset is already locked
|
128 |
# NOTE: change it to read_only=True when querying the dataset
|
|
|
151 |
db = DeepLake(dataset_path=dataset_path,
|
152 |
embedding_function=embeddings,
|
153 |
token=os.environ['ACTIVELOOP_TOKEN'],
|
154 |
+
read_only=False,
|
155 |
+
num_workers=12,
|
156 |
+
runtime = {"tensor_db": True}
|
157 |
+
)
|
158 |
# Do this in chunks to avoid hitting the ratelimit immediately
|
159 |
for i in range(0, len(texts), 500):
|
160 |
print("Adding documents " + str(i))
|