Commit Graph

5 Commits

Author SHA1 Message Date
guillaume-be
84561ec82b
Tokenizer special token map update (#330)
* Updates for compatibility with tokenizers special token rework

* Updated mask pipline methods

* Bumped version

* Fix clippy warnings
2023-01-30 17:53:18 +00:00
Anna Melnikov
a34cf9f8e4
Make predict methods in ZeroShot pipeline return Result instead of panicking on unwrap (#301)
* Add checked prediction methods

- Add checked prediction methods to ZeroShotClassificationModel.
These methods return Option and convert any underlying errors into None,
to allow callers to implement appropriate error handling logic.

* Update ZeroShot example to use checked method.

* Add tests for ZeroShot checked methods

* Change checked prediction methods to return Result

* refactor: rename *_checked into try_*

Rename *_checked methods into try_* methods.
This is more idiomatic vis-a-vis the Rust standard library.

* refactor: remove try_ prefix from predict methods

* refactor: change return from Option to Result

Change return type of ZeroShotClassificationModel.prepare_for_model
from option into Result. This simplifies the code, and returns
the error closer to its origin.

This addresses comments from @guillaume-be.

* refactor: address clippy lints in tests

Co-authored-by: guillaume-be <guillaume.becquin@gmail.com>
2022-12-04 09:10:01 +00:00
guillaume-be
c6771d3992
Update to tch=0.9.0 (#293)
* Fixed short sentence input and added documentation

* Fixed Clippy warnings

* Updated CI Python version

* cleaner dim specification
2022-11-07 17:45:52 +00:00
Guillaume B
6e9a0310e3 Updated examples and tests for zero shot classification
Multilabel example for zero-shot classification
2020-09-06 10:39:18 +02:00
Guillaume B
b52b0cb005 Addition of integration tests for zero-shot classification 2020-09-05 15:02:34 +02:00