You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 7d80d95
Browse filesBrowse the repository at this point in the historyBrowse files
authored
FIX Seed removal list filters match whole elements instead of JSON substrings (#2811)
Co-authored-by: Roman Lutz <romanlutz13@gmail.com>
Co-authored-by: hannahwestra25 <hannahwestra@microsoft.com>
Copy file name to clipboardExpand all lines: doc/code/memory/8_seed_database.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -286,7 +286,7 @@
286
286
"\n",
287
287
"For the most part these are user errors, but when you want to remove whole groups rather than individual seeds, use `remove_seed_groups_from_memory`. It applies the same filters, but removes every seed that shares a `prompt_group_id` with any match, so groups are never left partial. Note that it only affects seeds that belong to a group: a matching seed added individually (with no `prompt_group_id`) is skipped, so use `remove_seeds_from_memory` for those.\n",
288
288
"\n",
289
-
"> **Note on deleting by `value`.** For the remove methods, the `value` filter defaults to full-string equality (`exact=True`), so `remove_seeds_from_memory(value=\"the\")` deletes only seeds whose value is exactly `\"the\"` — not everything containing it. This differs from `get_seeds`, which always matches `value` by substring. Pass `exact=False` to opt into substring deletion when you really want it. As a general rule, preview with the same filters via `get_seeds(...)` first and prefer a specific filter (such as `dataset_name` or `value_sha256`) for deletion.\n",
289
+
"> **Note on deleting by `value`.** For the remove methods, the `value` filter defaults to full-string equality (`exact=True`), so `remove_seeds_from_memory(value=\"the\")` deletes only seeds whose value is exactly `\"the\"` — not everything containing it. This differs from `get_seeds`, which always matches `value` by substring. The same applies to the list filters: `harm_categories`, `authors`, `groups` and `parameters` must match whole list elements (case-insensitive), so `remove_seeds_from_memory(harm_categories=[\"hate\"])` does not also remove seeds tagged `\"hate_speech\"`. Pass `exact=False` to opt into substring deletion when you really want it. As a general rule, preview with the same filters via `get_seeds(...)` first and prefer a specific filter (such as `dataset_name` or `value_sha256`) for deletion. Because `get_seeds` always matches by substring, the preview is a superset of what the remove methods delete: some previewed seeds will survive the deletion, which is expected.\n",
290
290
"\n",
291
291
"> **Note on file-backed seeds.** For `image_path`, `audio_path`, and `video_path` seeds, removal deletes only the database record; the serialized file on disk is left in place. Delete those files separately if they are no longer needed."
Copy file name to clipboardExpand all lines: doc/code/memory/8_seed_database.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,6 @@ def print_group(seed_group):
145
145
#
146
146
# For the most part these are user errors, but when you want to remove whole groups rather than individual seeds, use `remove_seed_groups_from_memory`. It applies the same filters, but removes every seed that shares a `prompt_group_id` with any match, so groups are never left partial. Note that it only affects seeds that belong to a group: a matching seed added individually (with no `prompt_group_id`) is skipped, so use `remove_seeds_from_memory` for those.
147
147
#
148
-
# > **Note on deleting by `value`.** For the remove methods, the `value` filter defaults to full-string equality (`exact=True`), so `remove_seeds_from_memory(value="the")` deletes only seeds whose value is exactly `"the"` — not everything containing it. This differs from `get_seeds`, which always matches `value` by substring. Pass `exact=False` to opt into substring deletion when you really want it. As a general rule, preview with the same filters via `get_seeds(...)` first and prefer a specific filter (such as `dataset_name` or `value_sha256`) for deletion.
148
+
# > **Note on deleting by `value`.** For the remove methods, the `value` filter defaults to full-string equality (`exact=True`), so `remove_seeds_from_memory(value="the")` deletes only seeds whose value is exactly `"the"` — not everything containing it. This differs from `get_seeds`, which always matches `value` by substring. The same applies to the list filters: `harm_categories`, `authors`, `groups` and `parameters` must match whole list elements (case-insensitive), so `remove_seeds_from_memory(harm_categories=["hate"])` does not also remove seeds tagged `"hate_speech"`. Pass `exact=False` to opt into substring deletion when you really want it. As a general rule, preview with the same filters via `get_seeds(...)` first and prefer a specific filter (such as `dataset_name` or `value_sha256`) for deletion. Because `get_seeds` always matches by substring, the preview is a superset of what the remove methods delete: some previewed seeds will survive the deletion, which is expected.
149
149
#
150
150
# > **Note on file-backed seeds.** For `image_path`, `audio_path`, and `video_path` seeds, removal deletes only the database record; the serialized file on disk is left in place. Delete those files separately if they are no longer needed.
0 commit comments