Trim carriage return from hyp and lora txts

This commit is contained in:
Dominik Reh
2023-01-28 22:30:04 +01:00
parent a925129981
commit dc34db53e4

View File

@@ -1181,6 +1181,7 @@ async function setup() {
try {
hypernetworks = (await readFile(`${tagBasePath}/temp/hyp.txt?${new Date().getTime()}`)).split("\n")
.filter(x => x.trim().length > 0) //Remove empty lines
.map(x => x.trim()); // Remove carriage returns and padding if it exists
} catch (e) {
console.error("Error loading hypernetworks.txt: " + e);
}
@@ -1190,6 +1191,7 @@ async function setup() {
try {
loras = (await readFile(`${tagBasePath}/temp/lora.txt?${new Date().getTime()}`)).split("\n")
.filter(x => x.trim().length > 0) // Remove empty lines
.map(x => x.trim()); // Remove carriage returns and padding if it exists
} catch (e) {
console.error("Error loading lora.txt: " + e);
}