You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using the LTP/legacy model, if the input text is empty, it will cause rust to report an error and exit.
During batch data processing, empty or abnormal content will appear in the middle, causing the program to crash, and the exception cannot be handled using python's try catch.
oading weights from local directory
thread '<unnamed>' panicked at 'index out of bounds: the len is 0 but the index is 0', /home/runner/work/ltp/ltp/rust/ltp/src/perceptron/model.rs:130:30
stack backtrace:
0: rust_begin_unwind
at /rustc/36fb58e433c782e27dd41034284e157cf86d587f/library/std/src/panicking.rs:593:5
1: core::panicking::panic_fmt
at /rustc/36fb58e433c782e27dd41034284e157cf86d587f/library/core/src/panicking.rs:67:14
2: core::panicking::panic_bounds_check
at /rustc/36fb58e433c782e27dd41034284e157cf86d587f/library/core/src/panicking.rs:162:5
3: ltp::perceptron::model::Perceptron<ltp::perceptron::definition::cws::CWSDefinition,Feature,ParamStorage,Param>::predict
4: ltp_extension::perceptron::specialization::cws::PyCWSModel::predict
5: ltp_extension::perceptron::specialization::cws::_::<impl ltp_extension::perceptron::specialization::cws::PyCWSModel>::__pymethod___call____
6: pyo3::impl_::trampoline::trampoline_inner
7: ltp_extension::perceptron::specialization::cws::_::<impl pyo3::impl_::pyclass::PyMethods<ltp_extension::perceptron::specialization::cws::PyCWSModel> for pyo3::impl_::pyclass::PyClassImplCollector<ltp_extension::perceptron::specialization::cws::PyCWSModel>>::py_methods::ITEMS::trampoline
8: PyObject_Call
at /usr/local/src/conda/python-3.7.16/Objects/call.c:245:19
9: do_call_core
at /usr/local/src/conda/python-3.7.16/Python/ceval.c:4645:16
10: _PyEval_EvalFrameDefault
The text was updated successfully, but these errors were encountered:
yoyoo333
changed the title
When using the LTP/legacy model, if the input text is empty, it will cause rust to report an error and exit.
Big Bug: program error and exit
Sep 25, 2023
When using the LTP/legacy model, if the input text is empty, it will cause rust to report an error and exit.
During batch data processing, empty or abnormal content will appear in the middle, causing the program to crash, and the exception cannot be handled using python's try catch.
Below is the usage code:
The error message is as follows:
The text was updated successfully, but these errors were encountered: