segment-any-text / wtpsplit

Toolkit to segment text into sentences or other semantic units in a robust, efficient and adaptable way.
MIT License
677 stars 39 forks source link

PanicException with 0.4.* #19

Closed MiniXC closed 3 years ago

MiniXC commented 3 years ago

After installing the new version, I get the following exception when running NNSplit.load("en").

PanicException: called `Result::unwrap()` on an `Err` value: PyErr { type: Py(0x5632cc1b1140, PhantomData) }

This occurs both with and without onnxruntime-gpu installed.

MiniXC commented 3 years ago

I think this could be because I still have an old version of the model cached somewhere, is there some way to clear the cache?

bminixhofer commented 3 years ago

Weird. You can try clearing the cache, probably at ~/.cache/nnsplit/ on Linux. But I don't see how the cache could be a problem, the model hasn't changed since 0.3.x. I'll look into better reporting of errors from Python, that would make it easier to solve this.

MiniXC commented 3 years ago

haha just a prank, it works now

bminixhofer commented 3 years ago

For anyone else with this problem: pip install --upgrade --ignore-installed nnsplit seems to have fixed this here.

MiniXC commented 3 years ago

When getting PanicExceptions when using gpu, downgrading to onnxruntime-gpu==1.4.0 fixed it for me.