Skip to content

Commit 260dc7f

Browse files
Address code review: keep numeric input_id format; clean up error message
Agent-Logs-Url: https://github.com/Clarifai/clarifai-python-datautils/sessions/2f6a225b-0e99-4d58-9831-b149d5e68787 Co-authored-by: sanjaychelliah <65780631+sanjaychelliah@users.noreply.github.com>
1 parent 764fb89 commit 260dc7f

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

clarifai_datautils/image/annotation_conversion/loaders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,8 @@ def __getitem__(self, index: int):
137137

138138
if len(concept_ids) != len(annots):
139139
raise ValueError(
140-
f"Num concepts must match num bbox annotations"
141-
f" for a single image. Found {len(concept_ids)} concepts and {len(annots)} bboxes."
140+
f"Num concepts must match num bbox annotations for a single image."
141+
f" Found {len(concept_ids)} concepts and {len(annots)} bboxes."
142142
)
143143

144144
return VisualDetectionFeatures(

clarifai_datautils/multimodal/pipeline/summarizer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def __call__(self, elements: List) -> List:
5858
if isinstance(element, Image):
5959
element.metadata.update(
6060
ElementMetadata.from_dict({
61-
'input_id': secrets.token_hex(4)
61+
'input_id': str(secrets.randbelow(89000000) + 1000000)
6262
}))
6363
img_elements.append(element)
6464
new_elements = self._summarize_image(img_elements)

0 commit comments

Comments
 (0)