From 6480336d2cd1879682b5b36b7cd0941d895c85c4 Mon Sep 17 00:00:00 2001 From: Maw-Fox Date: Fri, 11 Nov 2022 17:17:50 -0700 Subject: [PATCH] Cleanup test code. --- trainer/diffusers_trainer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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() # ====================================== #