mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-11-29 16:57:06 +03:00
fix genai and classification error paths (#25077)
- Catch all httpx errors in the Ollama plugin so a dropped connection no longer ends the embeddings thread - Strip only a trailing /v1 from the llama.cpp base_url - Cap the timestamp top-up loop in state example generation, which looped forever on zero-length review items - Run state example generation in a thread under the example collection lock - Stage example frames in a system temp dir so a leftover dataset/temp folder can't become a training class - Report face training success only after the image is written, and return 404 when the event has no face attributes or snapshot - Move VLM watch setup inside the runner's try block, build the runner before claiming the watch slot, bound max_duration_minutes, and reject non-string labels and zones from the chat tool
This commit is contained in:
@@ -7,7 +7,10 @@ from unittest.mock import patch
|
||||
|
||||
import numpy as np
|
||||
|
||||
from frigate.util.classification import _extract_event_thumbnails
|
||||
from frigate.util.classification import (
|
||||
_extract_event_thumbnails,
|
||||
_select_balanced_timestamps,
|
||||
)
|
||||
|
||||
|
||||
class TestExtractEventThumbnails(unittest.TestCase):
|
||||
@@ -29,5 +32,17 @@ class TestExtractEventThumbnails(unittest.TestCase):
|
||||
self.assertEqual(load.call_count, 7)
|
||||
|
||||
|
||||
class TestSelectBalancedTimestamps(unittest.TestCase):
|
||||
def test_terminates_when_items_cannot_fill_target(self):
|
||||
items = [
|
||||
SimpleNamespace(camera="front", start_time=1000.0, end_time=1000.0),
|
||||
SimpleNamespace(camera="front", start_time=2000.0, end_time=2001.0),
|
||||
]
|
||||
|
||||
timestamps = _select_balanced_timestamps(items, target_count=100)
|
||||
|
||||
self.assertEqual(len(timestamps), 1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user