From: Nicolas Patry Date: Thu, 17 Nov 2022 19:08:25 +0000 (+0100) Subject: Fixing unimplemented into real exception. (#78) X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=25b4d4794f46074eb73894d52e180052614dc47a;p=safetensors.git Fixing unimplemented into real exception. (#78) --- diff --git a/bindings/python/src/lib.rs b/bindings/python/src/lib.rs index b5f40fb..81f7d00 100644 --- a/bindings/python/src/lib.rs +++ b/bindings/python/src/lib.rs @@ -64,7 +64,9 @@ fn prepare(tensor_dict: HashMap) -> PyResult Dtype::F64, "bfloat16" => Dtype::BF16, dtype_str => { - unimplemented!("Did not cover this dtype: {}", dtype_str) + return Err(exceptions::PyException::new_err(format!( + "dtype {dtype_str} is not covered", + ))); } } }