Fix invalid path (#2114)

* Fix korean invalid path

* Fix japanese invalid path

* Fix langsegmenter invalid path
This commit is contained in:
KamioRinn
2025-02-26 23:37:19 +08:00
committed by GitHub
parent 8158a97909
commit 237526a7e6
3 changed files with 44 additions and 6 deletions

View File

@@ -50,7 +50,7 @@ def load_fasttext_model(
model = fast_langdetect.ft_detect.infer.fasttext.load_model(str(model_path))
else:
python_dir = os.getcwd()
if (str(model_path)[:len(python_dir)] == python_dir):
if (str(model_path)[:len(python_dir)].upper() == python_dir.upper()):
model = fast_langdetect.ft_detect.infer.fasttext.load_model(os.path.relpath(model_path, python_dir))
else:
import tempfile