Skip to content

Commit a253ab9

Browse files
author
Daniel Lorch
committed
chore: remove whitespace
1 parent fe4c272 commit a253ab9

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

notebooks/examples/dynamic-few-shot-lambda/GENAIIDP-dynamic-few-shot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ def _extract_metadata(metadata, distance):
194194
image_data = _get_image_data_from_s3_path(image_path)
195195
encoded_images = _encode_images(image_data)
196196
attributes["image_content"] = encoded_images
197-
197+
198198
return attributes
199199

200200
def _get_image_data_from_s3_path(image_path):
@@ -227,7 +227,7 @@ def _get_image_data_from_s3_path(image_path):
227227
except Exception as e:
228228
logger.warning(f"Failed to load image {image_file_path}: {e}")
229229
continue
230-
230+
231231
return image_content
232232

233233
def _get_image_files_from_s3_path(image_path):

notebooks/examples/dynamic-few-shot-lambda/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ flowchart TD
2626
A[Document Processing] --> B{Dynamic-few shot configured?}
2727
B -->|No| C[Use Default Extraction]
2828
B -->|Yes| D[Invoke Dynamic-few shot Lambda]
29-
29+
3030
subgraph Lambda
3131
D --> E[Receive Document Images]
3232
E --> F[Generate Embeddings with Nova]
@@ -35,27 +35,27 @@ flowchart TD
3535
H --> I[Load Example Images from S3]
3636
I --> J[Format Examples for Bedrock]
3737
end
38-
38+
3939
J --> K[Use Examples in Extraction Prompt]
4040
C --> L[Continue with Standard Extraction]
4141
K --> L
42-
42+
4343
subgraph Input
4444
M[Document Class]
4545
N[Document Text]
4646
O[Document Images]
4747
end
48-
48+
4949
subgraph Output
5050
P[Example Attributes Prompts]
5151
Q[Example Images]
5252
R[Similarity Distances]
5353
end
54-
54+
5555
D -.-> M
5656
D -.-> N
5757
D -.-> O
58-
58+
5959
J -.-> P
6060
J -.-> Q
6161
J -.-> R
@@ -163,7 +163,7 @@ def merge_examples(combined_examples, new_examples):
163163
if combined_examples.get(key):
164164
# Keep the better (lower) distance score
165165
combined_examples[key]["distance"] = min(
166-
new_example.get("distance"),
166+
new_example.get("distance"),
167167
combined_examples[key]["distance"]
168168
)
169169
```

0 commit comments

Comments
 (0)