Commit 5186b326 authored by pythongosssss's avatar pythongosssss
Browse files

Prevent generating bad replacement regex

parent 04d9bc13
......@@ -131,6 +131,7 @@ export async function importA1111(graph, parameters) {
}
function replaceEmbeddings(text) {
if(!embeddings.length) return text;
return text.replaceAll(
new RegExp(
"\\b(" + embeddings.map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("\\b|\\b") + ")\\b",
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment