mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-03-17 21:58:22 +03:00
fix: initialize result variable in generate_description_embedding
The result variable is only assigned inside the semantic_search.enabled and len(new_description) > 0 conditions. If either is false, the return statement references an undefined variable, raising UnboundLocalError. Initialize result = None before the conditional block.
This commit is contained in:
parent
722ef6a1fe
commit
4c30f1e467
@ -1639,6 +1639,7 @@ def generate_description_embedding(
|
||||
body: EventsDescriptionBody,
|
||||
):
|
||||
new_description = body.description
|
||||
result = None
|
||||
|
||||
# If semantic search is enabled, update the index
|
||||
if request.app.frigate_config.semantic_search.enabled:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user