Skip to content

Commit

Permalink
Fixing error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Nov 6, 2024
1 parent 61780f6 commit 6a2ad5c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bindings/python/src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ impl PyBPE {
fn _resize_cache(self_: PyRef<Self>, capacity: usize) -> PyResult<()> {
let super_ = self_.as_ref();
let mut model = super_.model.write().map_err(|e| {
exceptions::PyException::new_err(format!("Error while clearing BPE cache: {}", e))
exceptions::PyException::new_err(format!("Error while resizing BPE cache: {}", e))
})?;
model.resize_cache(capacity);
Ok(())
Expand Down Expand Up @@ -889,7 +889,7 @@ impl PyUnigram {
fn _clear_cache(self_: PyRef<Self>) -> PyResult<()> {
let super_ = self_.as_ref();
let mut model = super_.model.write().map_err(|e| {
exceptions::PyException::new_err(format!("Error while clearing BPE cache: {}", e))
exceptions::PyException::new_err(format!("Error while clearing Unigram cache: {}", e))
})?;
model.clear_cache();
Ok(())
Expand All @@ -901,7 +901,7 @@ impl PyUnigram {
fn _resize_cache(self_: PyRef<Self>, capacity: usize) -> PyResult<()> {
let super_ = self_.as_ref();
let mut model = super_.model.write().map_err(|e| {
exceptions::PyException::new_err(format!("Error while clearing BPE cache: {}", e))
exceptions::PyException::new_err(format!("Error while resizing Unigram cache: {}", e))
})?;
model.resize_cache(capacity);
Ok(())
Expand Down

0 comments on commit 6a2ad5c

Please sign in to comment.