Add a vision transformer example (dino-v2). (#502)

* Add a vision transformer example (dino-v2).

* Add some documentation + test.

* CI fix.

* Another fix (still unable to replicate the errors locally :( )
This commit is contained in:
Laurent Mazare
2023-08-18 11:58:06 +01:00
committed by GitHub
parent b9661a1c25
commit 95462c6a2e
4 changed files with 351 additions and 2 deletions

View File

@ -147,7 +147,7 @@ And rewrite our examples using it
# extern crate candle_core;
# extern crate candle_nn;
use candle_core::{DType, Device, Result, Tensor};
use candle_nn::Linear;
use candle_nn::{Linear, Module};
struct Model {
first: Linear,

View File

@ -58,7 +58,7 @@ Now that we have our weights, we can use them in our bert architecture:
#
# let weights = repo.get("model.safetensors").unwrap();
use candle_core::{Device, Tensor, DType};
use candle_nn::Linear;
use candle_nn::{Linear, Module};
let weights = candle_core::safetensors::load(weights, &Device::Cpu).unwrap();