FastText.NetWrapper icon indicating copy to clipboard operation
FastText.NetWrapper copied to clipboard

Can't load published pre-trained models

Open phatcher opened this issue 9 months ago • 0 comments

I get a native library exception when trying to load pre-trained models downloaded from the Fasttext site e.g. the language identification model, lid.176.bin

Wrote a simple unit test

[Fact]
public void CanLoadBinaryModel()
{
    using var fastText = new FastTextWrapper(loggerFactory: _loggerFactory);
    string file = Path.Combine(_tempDir, "lid.176.bin");

    fastText.LoadModel(file);

    fastText.IsModelReady().Should().BeTrue();
}

which throws the exception

FastText.NetWrapper.NativeLibraryException
C:\Users\paulh\AppData\Local\Temp\1c3778c52cad44aa9de4d24492380b2b\lid.176.bin cannot be opened for loading!

Looking around this seems to imply there's a model version difference between the fasttext binary and the trained model

phatcher avatar May 10 '25 10:05 phatcher