caikit / caikit-nlp

Apache License 2.0
12 stars 47 forks source link

Improve error handling on empty data streams #214

Closed evaline-ju closed 1 year ago

evaline-ju commented 1 year ago

Describe the bug

When running prompt tuning with an empty datastream, we get an obscure:

value check failed: Buffer size must be an int > 0

error back.

The data stream wrapper sets the buffer length to the length of the data stream, but doesn't check up front if the stream is length 0, then fails later on. It would be a much more usable error message if we checked up-front and rejected empty streams.