mirror of
https://github.com/farcasclaudiu/Flowise.git
synced 2026-06-29 05:01:10 +03:00
chck for empty string
This commit is contained in:
+1
@@ -19,6 +19,7 @@ export class SimplePromptModerationRunner implements Moderation {
|
|||||||
if (this.model) {
|
if (this.model) {
|
||||||
const denyArray = this.denyList.split('\n')
|
const denyArray = this.denyList.split('\n')
|
||||||
for (const denyStr of denyArray) {
|
for (const denyStr of denyArray) {
|
||||||
|
if (!denyStr || denyStr === '') continue
|
||||||
const res = await this.model.invoke(
|
const res = await this.model.invoke(
|
||||||
`Are these two sentences similar to each other? Only return Yes or No.\nFirst sentence: ${input}\nSecond sentence: ${denyStr}`
|
`Are these two sentences similar to each other? Only return Yes or No.\nFirst sentence: ${input}\nSecond sentence: ${denyStr}`
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user