]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] Auto-load shipped fasttext model when present 6067/head
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 29 May 2026 08:05:46 +0000 (09:05 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 29 May 2026 08:09:14 +0000 (09:09 +0100)
commit52895cd109c537ccadd72161524b2def21dadd35
tree675259fc7877642fddf633388cb925d788c390de
parent434706f36d9e8283456f8bfed9622211de6e9629
[Feature] Auto-load shipped fasttext model when present

When no fasttext_model is configured, fall back to the model shipped at
$SHAREDIR/languages/fasttext_model.ftz: if the file is readable, load
it via the existing direct-load path; otherwise stay silent (debug
only) so stock installs without the model behave exactly as before.

This lets images that ship the model file drop the explicit
fasttext_model config override. The success path reuses
load_model_direct (the same code used for an explicit fasttext_model),
and the absent-file case produces no error and leaves the detector
reporting 'fasttext model is not loaded' as before.
conf/lang_detection.inc
src/libmime/lang_detection_fasttext.cxx