Spaces:
Sleeping
Sleeping
Aiswarya Sankar
commited on
Commit
·
3f3f439
1
Parent(s):
d127f4b
Clean code
Browse files
app.py
CHANGED
@@ -115,6 +115,7 @@ def index_repo(textbox: str, dropdown: str) -> Response:
|
|
115 |
|
116 |
activeloop_username = "aiswaryas"
|
117 |
dataset_path = f"hub://{activeloop_username}/" + pathName
|
|
|
118 |
|
119 |
try:
|
120 |
try:
|
@@ -129,8 +130,9 @@ def index_repo(textbox: str, dropdown: str) -> Response:
|
|
129 |
print("Failed to read: " + str(e))
|
130 |
if "scheduled for deletion" in str(e):
|
131 |
dataset_path = f"hub://{activeloop_username}/" + pathName + str(random.randint(1,100))
|
|
|
132 |
|
133 |
-
if db is None or len(db.vectorstore.dataset) == 0:
|
134 |
print("Dataset doesn't exist, fetching data")
|
135 |
try:
|
136 |
docs = []
|
|
|
115 |
|
116 |
activeloop_username = "aiswaryas"
|
117 |
dataset_path = f"hub://{activeloop_username}/" + pathName
|
118 |
+
invalid_dataset_path = False
|
119 |
|
120 |
try:
|
121 |
try:
|
|
|
130 |
print("Failed to read: " + str(e))
|
131 |
if "scheduled for deletion" in str(e):
|
132 |
dataset_path = f"hub://{activeloop_username}/" + pathName + str(random.randint(1,100))
|
133 |
+
invalid_dataset_path = True
|
134 |
|
135 |
+
if db is None or len(db.vectorstore.dataset) == 0 or invalid_dataset_path:
|
136 |
print("Dataset doesn't exist, fetching data")
|
137 |
try:
|
138 |
docs = []
|