fix: Skip translation if the content is null. (#1136)
This commit is contained in:
parent
c1acd5b3f0
commit
81caf99fb5
|
|
@ -88,8 +88,15 @@ const getOriginalTranslation = async (
|
|||
translationChains.set(`${modelSize}_${targetLang}`, chain)
|
||||
}
|
||||
|
||||
const t = await chain.call({ text: title })
|
||||
const c = await chain.call({ text: content })
|
||||
const t =
|
||||
String(title).trim().length === 0
|
||||
? { text: "" }
|
||||
: await chain.call({ text: title })
|
||||
|
||||
const c =
|
||||
String(content).trim().length === 0
|
||||
? { text: "" }
|
||||
: await chain.call({ text: content })
|
||||
|
||||
console.timeEnd(`fetching translation ${cid}, ${targetLang}`)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue