]> Untitled Git - axy/ft/rag.git/commitdiff
Tiny fix
authorAxy <gilliardmarthey.axel@gmail.com>
Fri, 28 Aug 2026 15:01:23 +0000 (17:01 +0200)
committerAxy <gilliardmarthey.axel@gmail.com>
Fri, 28 Aug 2026 15:01:23 +0000 (17:01 +0200)
src/rag/evaluate.py

index 296743f3bfd6250b2cbaa40feecc4f7c0e74caf8..51803909c69a98c89cee414fd144f6e264fd3cff 100644 (file)
@@ -5,6 +5,8 @@ from rag.models import Source
 
 def sources_overlap(a: Source, b: Source, min_iou: float) -> bool:
     """Check whether two sources overlap with a minimum IoU."""
+    if a.file_path != b.file_path:
+        return False
     union_start = min(a.first_character_index, b.first_character_index)
     union_end = max(a.last_character_index, b.last_character_index) + 1
     union = union_end - union_start