Fix CI lint violations
CI / test (push) Failing after 9s

This commit is contained in:
2026-10-01 22:47:09 +08:00
parent b3774e783c
commit c064d15d8a
3 changed files with 9 additions and 4 deletions
+6 -2
View File
@@ -44,9 +44,13 @@ def render_scene(record: dict[str, Any], output_path: Path, image_size: int = 22
for index in range(10):
current_radius = radius if index % 2 == 0 else radius * 0.45
angle = -math.pi / 2 + index * math.pi / 5
points.append((x + current_radius * math.cos(angle), y + current_radius * math.sin(angle)))
points.append(
(
x + current_radius * math.cos(angle),
y + current_radius * math.sin(angle),
)
)
draw.polygon(points, fill=color, outline=(20, 20, 20))
draw.text((x - radius, y + radius + int(4 * scale)), item["object_id"], fill=(20, 20, 20))
output_path.parent.mkdir(parents=True, exist_ok=True)
image.save(output_path)
-1
View File
@@ -14,7 +14,6 @@ from data.schema import FACT_TYPE, NULL_TYPE, RULE_TYPE
from losses.matching_loss import hungarian_matching_loss
from models.evidence_model import EvidenceExtractorModel
COUNT_KEYS = ("tp", "fp", "fn", "component_correct", "component_total")
+3 -1
View File
@@ -54,7 +54,9 @@ class TinyFrozenBackbone(FrozenBackbone):
ids.append((int.from_bytes(digest, "little") % 256) + 1)
encoded.append(ids or [1])
length = max(len(row) for row in encoded)
input_ids = torch.zeros(len(encoded), length, dtype=torch.long, device=self.patch.weight.device)
input_ids = torch.zeros(
len(encoded), length, dtype=torch.long, device=self.patch.weight.device
)
mask = torch.zeros_like(input_ids, dtype=torch.bool)
for index, row in enumerate(encoded):
input_ids[index, : len(row)] = torch.tensor(row, device=input_ids.device)