pykeio / ort

Fast ML inference & training for Rust with ONNX Runtime
https://ort.pyke.io/
Apache License 2.0
786 stars 91 forks source link

Feedback for “Migrating from v1.x to v2” #263

Closed AbhishekBose closed 4 weeks ago

AbhishekBose commented 4 weeks ago
Why am I getting this error? error[E0599]: no method named commit_from_url found for struct SessionBuilder in the current scope --> src/main.rs:82:10 76 let session = Session::builder() ___- 77 .unwrap() 78 .with_optimization_level(GraphOptimizationLevel::Level1) 79 .unwrap() 80 .with_intra_threads(1) 81 .unwrap() 82 .commit_from_url("https://parcel.pyke.io/v2/cdn/assetdelivery/ortrsv2/ex_models/all-MiniLM-L6-v2.onnx") _____-^^^^^^^^^^^^^^^

The documentation says that commit_from_url is present in v2. This is my .toml file

[dependencies] actix-web = "4.9.0" ndarray = "0.16.1" ort = "2.0.0-rc.4" serde = "1.0.207" tokenizers = "0.20.0" tokio = "1.39.2"

Inside builder I am able to see this

Screenshot 2024-08-15 at 2 03 41 PM

decahedron1 commented 4 weeks ago

commit_from_url and with_model_downloaded are gated behind the fetch-models feature, as shown in the SessionBuilder docs: https://docs.rs/ort/2.0.0-rc.4/ort/struct.SessionBuilder.html#method.commit_from_url

Enable the fetch-models feature for ort to use the method.