Skip to content

Commit

Permalink
properly error out
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurZucker committed Nov 14, 2023
1 parent 88d862b commit c646978
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bindings/python/src/pre_tokenizers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,9 @@ impl PyMetaspace {

// If a prepend scheme is provided, set it
if let Some(prepend_scheme) = prepend_scheme {
if let Ok(prepend_scheme_enum) = _from_string(prepend_scheme) {
new_instance.set_prepend_scheme(prepend_scheme_enum);
} else {
return Err(err);
match _from_string(prepend_scheme) {
Ok(prepend_scheme_enum) => new_instance.set_prepend_scheme(prepend_scheme_enum),
Err(err) => return Err(err),
}
}
Ok((PyMetaspace {}, new_instance.into()))
Expand Down

0 comments on commit c646978

Please sign in to comment.