diff --git a/factgenie/static/js/manage.js b/factgenie/static/js/manage.js
index 6d2434a..5c84056 100644
--- a/factgenie/static/js/manage.js
+++ b/factgenie/static/js/manage.js
@@ -74,7 +74,7 @@ function deleteOutput(dataset, split, setup_id) {
alert(response.error);
} else {
// reload
- window.location.hash = "#local";
+ window.location.hash = "#outputs";
location.reload();
}
}
diff --git a/factgenie/templates/pages/manage.html b/factgenie/templates/pages/manage.html
index 8d2058c..0b746f1 100755
--- a/factgenie/templates/pages/manage.html
+++ b/factgenie/templates/pages/manage.html
@@ -172,7 +172,7 @@
-
diff --git a/factgenie/workflows.py b/factgenie/workflows.py
index b05c117..84b67d9 100644
--- a/factgenie/workflows.py
+++ b/factgenie/workflows.py
@@ -338,6 +338,7 @@ def load_outputs_from_file(file_path, cols):
# drop any keys that are not in the key set
j = {k: v for k, v in j.items() if k in cols}
+ j["jsonl_file"] = file_path
outputs.append(j)
except Exception as e:
logger.error(
@@ -347,6 +348,13 @@ def load_outputs_from_file(file_path, cols):
return outputs
+def remove_outputs(app, file_path):
+ """Remove outputs from the output index for a specific file"""
+ if app.db["output_index"] is not None:
+ # Filter out outputs from the specified file
+ app.db["output_index"] = app.db["output_index"][app.db["output_index"]["jsonl_file"] != file_path]
+
+
def get_output_index(app, force_reload=True):
if hasattr(app, "db") and app.db["output_index"] is not None and not force_reload:
return app.db["output_index"]
@@ -362,14 +370,14 @@ def get_output_index(app, force_reload=True):
# Handle modified files
for file_path, mod_time in current_outs.items():
if file_path not in cached_outs or cached_outs[file_path] < mod_time:
+ remove_outputs(app, file_path)
new_outputs.extend(load_outputs_from_file(file_path, cols))
# Handle deleted files
for file_path in set(cached_outs.keys()) - set(current_outs.keys()):
# Remove outputs for deleted files from the index
if app.db["output_index"] is not None:
- file_mask = app.db["output_index"]["file_path"] == file_path
- app.db["output_index"] = app.db["output_index"][~file_mask]
+ remove_outputs(app, file_path)
# Update the cache
app.db["output_index_cache"] = current_outs