From 7e254da69697938ab4886a504fd948d2d931efaf Mon Sep 17 00:00:00 2001 From: EricLBuehler Date: Sat, 15 Jun 2024 14:29:30 -0400 Subject: [PATCH] Fix with cfg pyo3 macros feature --- mistralrs-core/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mistralrs-core/src/lib.rs b/mistralrs-core/src/lib.rs index 7bc255b860..65446e7045 100644 --- a/mistralrs-core/src/lib.rs +++ b/mistralrs-core/src/lib.rs @@ -6,6 +6,7 @@ pub use engine::TERMINATE_ALL_NEXT_STEP; pub use lora::Ordering; use pipeline::ModelCategory; pub use pipeline::Pipeline; +#[cfg(feature = "pyo3_macros")] use pyo3::exceptions::PyValueError; use std::{ cell::RefCell, @@ -111,6 +112,7 @@ impl std::fmt::Display for MistralRsError { impl std::error::Error for MistralRsError {} +#[cfg(feature = "pyo3_macros")] impl From for pyo3::PyErr { fn from(value: MistralRsError) -> Self { PyValueError::new_err(format!("{:?}", value))