Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating to ort v2 #54

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions modules/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ license-file = "LICENSE"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]
axum-feature = ["axum"]
actix-feature = ["actix-web"]
default = []
# below are the features for testing different engines
sklearn-tests = []
Expand All @@ -20,7 +18,7 @@ tensorflow-tests = []

[dependencies]
regex = "1.9.3"
ort = { version = "1.16.2", features = ["load-dynamic"], default-features = false }
ort = { version = "2.0.0-rc.5", features = ["load-dynamic", "ndarray"], default-features = false }
ndarray = "0.15.6"
once_cell = "1.18.0"
bytes = "1.5.0"
Expand All @@ -29,9 +27,7 @@ futures-core = "0.3.28"
thiserror = "1.0.57"
serde = { version = "1.0.197", features = ["derive"] }
serde_json = "1.0"
axum = { version = "0.7.4", optional = true }
actix-web = { version = "4.5.1", optional = true }

nanoservices-utils = "0.1.5"

[dev-dependencies]
tokio = { version = "1.12.0", features = ["full"] }
Expand Down
20 changes: 20 additions & 0 deletions modules/core/src/errors.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

#[macro_export]
macro_rules! safe_eject_option {
($check:expr) => {
match $check {Some(x) => x, None => {let file_track = format!("{}:{}", file!(), line!());let message = format!("{}=>The value is not found", file_track);return Err(NanoServiceError::new(message, NanoServiceErrorStatus::NotFound))}}
};
}


#[macro_export]
macro_rules! safe_eject_internal {
// Match when the optional string is provided
($e:expr, $err_status:expr, $msg:expr) => {
$e.map_err(|x| {let file_track = format!("{}:{}", file!(), line!()); let formatted_error = format!("{} => {}", file_track, x.to_string()); NanoServiceError::new(formatted_error, NanoServiceErrorStatus::Unknown)})?
};
// Match when the optional string is not provided
($e:expr) => {
$e.map_err(|x| {let file_track = format!("{}:{}", file!(), line!()); let formatted_error = format!("{} => {}", file_track, x.to_string()); NanoServiceError::new(formatted_error, NanoServiceErrorStatus::Unknown)})?
};
}
57 changes: 0 additions & 57 deletions modules/core/src/errors/actix.rs

This file was deleted.

44 changes: 0 additions & 44 deletions modules/core/src/errors/axum.rs

This file was deleted.

101 changes: 0 additions & 101 deletions modules/core/src/errors/error.rs

This file was deleted.

7 changes: 0 additions & 7 deletions modules/core/src/errors/mod.rs

This file was deleted.

Loading
Loading