LaurentMazare / diffusers-rs

An implementation of the diffusers api in Rust
Apache License 2.0
539 stars 55 forks source link

Filter out unknown tokens instead of crashing #19

Closed sssemil closed 1 year ago

sssemil commented 1 year ago

Currently, when a word is not found, for example didn’t (notice the ’ instead of '), it just panics, since the unwrap is called on a None value.

Maybe you would prefer throwing an error instead, since this hides the oddity from the user.

LaurentMazare commented 1 year ago

Merged, thanks for the PR!