mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 19:18:50 +00:00

* Start onnx integration * Merge remote-tracking branch 'upstream/main' into feat/pyo3-onnx * Implement ONNXModel * `fmt` * add `onnx` flag to python ci * Pin `protoc` to `25.0` * Setup `protoc` in wheel builds * Build wheels with `onnx` * Install `protoc` in manylinux containers * `apt` -> `yum` * Download `protoc` via bash script * Back to `manylinux: auto` * Disable `onnx` builds for linux
15 lines
351 B
Rust
15 lines
351 B
Rust
use candle::Result;
|
|
use prost::Message;
|
|
|
|
pub mod onnx {
|
|
include!(concat!(env!("OUT_DIR"), "/onnx.rs"));
|
|
}
|
|
|
|
pub mod eval;
|
|
pub use eval::{dtype, simple_eval};
|
|
|
|
pub fn read_file<P: AsRef<std::path::Path>>(p: P) -> Result<onnx::ModelProto> {
|
|
let buf = std::fs::read(p)?;
|
|
onnx::ModelProto::decode(buf.as_slice()).map_err(candle::Error::wrap)
|
|
}
|