diff options
| author | Joanne <zehan_ding@brown.edu> | 2025-06-20 10:18:38 -0400 |
|---|---|---|
| committer | Joanne <zehan_ding@brown.edu> | 2025-06-20 10:18:38 -0400 |
| commit | 61787b3c1cf53c0230f6142bee0df30c65971012 (patch) | |
| tree | 36c43ca031722b9a92f3f344288c8f6cf7fff5e1 /src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx | |
| parent | 2aa2c26b95a539d220e46b20cdfbef6ae39d6c43 (diff) | |
| parent | e7a96fa043cfc9c3c426e09bbef42c8df88a45f6 (diff) | |
Merge branch 'master' of https://github.com/brown-dash/Dash-Web into joanne-tutorialagent
Diffstat (limited to 'src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx')
| -rw-r--r-- | src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx b/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx index ff9fb14e7..e3a3f9b05 100644 --- a/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx +++ b/src/client/views/collections/collectionFreeForm/ImageLabelBox.tsx @@ -160,15 +160,16 @@ export class ImageLabelBox extends ViewBoxBaseComponent<FieldViewProps>() { classifyImagesInBox = async () => { this.startLoading(); + const selectedImages = this._selectedImages; // Converts the images into a Base64 format, afterwhich the information is sent to GPT to label them. - const imageInfos = this._selectedImages.map(async doc => { + const imageInfos = selectedImages.map(async doc => { if (!doc.$tags_chat) { const url = ImageCastWithSuffix(doc[Doc.LayoutDataKey(doc)], '_o') ?? ''; return imageUrlToBase64(url).then(hrefBase64 => !hrefBase64 ? undefined : - gptImageLabel(hrefBase64,'Give three labels to describe this image.').then(labels => + gptImageLabel(hrefBase64, 'Give three labels to describe this image.').then(labels => ({ doc, labels }))) ; // prettier-ignore } }); |
