Skip to content

Commit a8b93d7

Browse files
fix: update path to upload file (#615)
1 parent 03a9dc8 commit a8b93d7

File tree

1 file changed

+4
-4
lines changed
  • lambda/aws-rag-appsync-stepfn-opensearch/s3_file_transformer/src/helpers

1 file changed

+4
-4
lines changed

lambda/aws-rag-appsync-stepfn-opensearch/s3_file_transformer/src/helpers/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def transform_image_document(input_bucket: str,file_name: str,output_bucket: str
6565
if(imt_object.check_moderation()):
6666
return 'Image not supported'
6767
else:
68-
result_lables = imt_object.detect_image_lables()
68+
result_labels = imt_object.detect_image_lables()
6969

7070
name, extension = os.path.splitext(file_name)
71-
lables_txt= convert_lables_to_sentence(result_lables)
71+
labels_txt= convert_lables_to_sentence(result_labels)
7272

7373
# upload descriptive text file as .txt for ingested image
74-
with open (tempfile.gettempdir()+name+'.txt','w') as f:
75-
f.write(json.dumps(lables_txt))
74+
with open (os.path.join(tempfile.gettempdir(), name+'.txt'),'w') as f:
75+
f.write(json.dumps(labels_txt))
7676
#s3.upload_file('/tmp/'+name+'.txt',output_bucket,name+".txt")
7777
upload_file(output_bucket,f'{name}.txt',f'{name}.txt')
7878

0 commit comments

Comments
 (0)