mirror of
https://github.com/ostris/ai-toolkit.git
synced 2026-04-30 19:21:39 +00:00
Various windows bug fixes
This commit is contained in:
@@ -35,7 +35,7 @@ class GenerateConfig:
|
||||
raise ValueError("Prompts must be set")
|
||||
if isinstance(self.prompts, str):
|
||||
if os.path.exists(self.prompts):
|
||||
with open(self.prompts, 'r') as f:
|
||||
with open(self.prompts, 'r', encoding='utf-8') as f:
|
||||
self.prompts = f.read().splitlines()
|
||||
self.prompts = [p.strip() for p in self.prompts if len(p.strip()) > 0]
|
||||
else:
|
||||
|
||||
@@ -87,7 +87,7 @@ class TrainSDRescaleProcess(BaseSDTrainProcess):
|
||||
self.print(f"Loading prompt file from {self.rescale_config.prompt_file}")
|
||||
|
||||
# read line by line from file
|
||||
with open(self.rescale_config.prompt_file, 'r') as f:
|
||||
with open(self.rescale_config.prompt_file, 'r', encoding='utf-8') as f:
|
||||
self.prompt_txt_list = f.readlines()
|
||||
# clean empty lines
|
||||
self.prompt_txt_list = [line.strip() for line in self.prompt_txt_list if len(line.strip()) > 0]
|
||||
|
||||
@@ -119,7 +119,7 @@ class TrainSliderProcess(BaseSDTrainProcess):
|
||||
|
||||
# read line by line from file
|
||||
if self.slider_config.prompt_file:
|
||||
with open(self.slider_config.prompt_file, 'r') as f:
|
||||
with open(self.slider_config.prompt_file, 'r', encoding='utf-8') as f:
|
||||
self.prompt_txt_list = f.readlines()
|
||||
# clean empty lines
|
||||
self.prompt_txt_list = [line.strip() for line in self.prompt_txt_list if len(line.strip()) > 0]
|
||||
|
||||
Reference in New Issue
Block a user