diff --git a/trainer/diffusers_trainer.py b/trainer/diffusers_trainer.py index 7cad170..34adf60 100644 --- a/trainer/diffusers_trainer.py +++ b/trainer/diffusers_trainer.py @@ -299,9 +299,9 @@ class ImageStore: # gets caption by removing the extension from the filename and replacing it with .txt def get_caption(self, ref: Tuple[int, int, int]) -> str: - #filename = re.sub('\.[^/.]+$', '', self.image_files[ref[0]]) + '.txt' - #with open(filename, 'r', encoding='UTF-8') as f: - return '' + filename = re.sub('\.[^/.]+$', '', self.image_files[ref[0]]) + '.txt' + with open(filename, 'r', encoding='UTF-8') as f: + return f.read() # ====================================== #