ai-comic-factory / src /lib /dirtyLLMResponseCleaner.ts
jbilcke-hf's picture
jbilcke-hf HF staff
try to improve robustness of LLM responses
2f7798c
raw
history blame
175 Bytes
export function dirtyLLMResponseCleaner(input: string) {
return (
`${input || ""}`
.replaceAll("}}", "}")
.replaceAll("]]", "]")
.replaceAll(",,", ",")
)
}