Allow hyphens in embeddings

This commit is contained in:
cmdr2 2023-08-31 22:16:48 +05:30
parent f02b915cd0
commit 670768e5b3

View File

@ -1345,7 +1345,7 @@ function setEmbeddings(task) {
let prompt = task.reqBody.prompt
let negativePrompt = task.reqBody.negative_prompt
let overallPrompt = (prompt + " " + negativePrompt).toLowerCase()
overallPrompt = overallPrompt.replaceAll(/[^a-z0-9\.]/g, " ") // only allow alpha-numeric and dots
overallPrompt = overallPrompt.replaceAll(/[^a-z0-9\-\.]/g, " ") // only allow alpha-numeric, dots and hyphens
overallPrompt = overallPrompt.split(" ")
let embeddingsTree = modelsOptions["embeddings"]