mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 10:38:54 +00:00
Removing cuda default.
Seems very important for a lot of exploring users usually on laptop without GPUs. Adding more README instructions in a follow up.
This commit is contained in:
@ -41,10 +41,18 @@ fn main() -> Result<()> {
|
||||
use tokenizers::Tokenizer;
|
||||
|
||||
let args = Args::parse();
|
||||
#[cfg(feature = "cuda")]
|
||||
let default_device = Device::new_cuda(0)?;
|
||||
|
||||
#[cfg(not(feature = "cuda"))]
|
||||
let default_device = {
|
||||
println!("Running on CPU, to run on GPU, run this example with `--features cuda`");
|
||||
Device::Cpu
|
||||
};
|
||||
let device = if args.cpu {
|
||||
Device::Cpu
|
||||
} else {
|
||||
Device::new_cuda(0)?
|
||||
default_device
|
||||
};
|
||||
|
||||
let mut tokenizer = Tokenizer::from_file(args.tokenizer).map_err(E::msg)?;
|
||||
|
Reference in New Issue
Block a user