diff --git a/candle-transformers/src/models/bert.rs b/candle-transformers/src/models/bert.rs index bd11b01a90..a7283ea52e 100644 --- a/candle-transformers/src/models/bert.rs +++ b/candle-transformers/src/models/bert.rs @@ -7,26 +7,26 @@ //! - Upstream [Github repo](https://github.com/google-research/bert). //! - See bert in [candle-examples](https://github.com/huggingface/candle/tree/main/candle-examples/) for runnable code //! -//! ```ignore -//! // for sentence embeddings +//! ```rust,text +//! // Different models can be loaded using the model ID //! # use candle_core::Tensor; //! # use candle_nn::{VarBuilder, Module}; //! # fn main() -> candle_core::Result<()> { -//! # let model = todo!(); -//! # let prompt = "Here is a test sentence"; -//! let embeddings = model.forward(prompt)?; -//! // Returns tensor of shape [1, 7, 384] -//! println!("{embeddings}"); +//! # let vb = todo!(); +//! # let config = todo!(); +//! let model = BertModel::load(vb, &config )?; //! # Ok(()) //! # } //! -//! // Different models can be loaded using the model ID +//! // for sentence embeddings //! # use candle_core::Tensor; //! # use candle_nn::{VarBuilder, Module}; //! # fn main() -> candle_core::Result<()> { -//! # let vb = todo!(); -//! # let config = todo!(); -//! let model = BertModel::load(vb, &config )?; +//! # let model = todo!(); +//! let prompt = "Here is a test sentence"; +//! let embeddings = model.forward(prompt)?; +//! // Returns tensor of shape [1, 7, 384] +//! println!("{embeddings}"); //! # Ok(()) //! # } //! diff --git a/candle-transformers/src/models/dinov2.rs b/candle-transformers/src/models/dinov2.rs index 2317eee239..d960adb51b 100644 --- a/candle-transformers/src/models/dinov2.rs +++ b/candle-transformers/src/models/dinov2.rs @@ -6,7 +6,7 @@ //! //! # Example usage //! -//! ```ignore +//! ```rust,text //! # use candle::Result; //! # fn main() -> Result<()> { //! use candle_transformers::dinov2::vit_small;