mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-07-17 09:21:13 +03:00
Cleanup
This commit is contained in:
parent
e9859f9c55
commit
b894252d38
@ -181,7 +181,9 @@ class VLMWatchRunner(threading.Thread):
|
|||||||
# Keep system prompt + last _MAX_HISTORY user/assistant pairs
|
# Keep system prompt + last _MAX_HISTORY user/assistant pairs
|
||||||
max_msgs = 1 + _MAX_HISTORY * 2
|
max_msgs = 1 + _MAX_HISTORY * 2
|
||||||
if len(self.conversation) > max_msgs:
|
if len(self.conversation) > max_msgs:
|
||||||
self.conversation = [self.conversation[0]] + self.conversation[-(max_msgs - 1):]
|
self.conversation = [self.conversation[0]] + self.conversation[
|
||||||
|
-(max_msgs - 1) :
|
||||||
|
]
|
||||||
|
|
||||||
try:
|
try:
|
||||||
clean = re.sub(
|
clean = re.sub(
|
||||||
@ -258,9 +260,7 @@ class VLMWatchRunner(threading.Thread):
|
|||||||
zones = self.job.zones
|
zones = self.job.zones
|
||||||
for obj in tracked_objects:
|
for obj in tracked_objects:
|
||||||
label_ok = not labels or obj.get("label") in labels
|
label_ok = not labels or obj.get("label") in labels
|
||||||
zone_ok = not zones or bool(
|
zone_ok = not zones or bool(set(obj.get("current_zones", [])) & set(zones))
|
||||||
set(obj.get("current_zones", [])) & set(zones)
|
|
||||||
)
|
|
||||||
if label_ok and zone_ok:
|
if label_ok and zone_ok:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user