mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 10:38:54 +00:00
s/panic/bail/
This commit is contained in:
@ -12,7 +12,7 @@ extern crate accelerate_src;
|
|||||||
#[cfg(feature = "mkl")]
|
#[cfg(feature = "mkl")]
|
||||||
extern crate intel_mkl_src;
|
extern crate intel_mkl_src;
|
||||||
|
|
||||||
use anyhow::{Error as E, Result};
|
use anyhow::{bail, Error as E, Result};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use candle::{DType, Tensor};
|
use candle::{DType, Tensor};
|
||||||
@ -104,7 +104,7 @@ fn main() -> Result<()> {
|
|||||||
Some("f16") => DType::F16,
|
Some("f16") => DType::F16,
|
||||||
Some("bf16") => DType::BF16,
|
Some("bf16") => DType::BF16,
|
||||||
Some("f32") => DType::F32,
|
Some("f32") => DType::F32,
|
||||||
Some(dtype) => panic!("Unsupported dtype {dtype}"),
|
Some(dtype) => bail!("Unsupported dtype {dtype}"),
|
||||||
None => DType::F16,
|
None => DType::F16,
|
||||||
};
|
};
|
||||||
let (llama, tokenizer_filename, cache) = match args.npy {
|
let (llama, tokenizer_filename, cache) = match args.npy {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
#[cfg(feature = "mkl")]
|
#[cfg(feature = "mkl")]
|
||||||
extern crate intel_mkl_src;
|
extern crate intel_mkl_src;
|
||||||
|
|
||||||
use anyhow::{Error as E, Result};
|
use anyhow::{bail, Error as E, Result};
|
||||||
use clap::Parser;
|
use clap::Parser;
|
||||||
|
|
||||||
use candle::{DType, Device, Tensor};
|
use candle::{DType, Device, Tensor};
|
||||||
@ -125,7 +125,7 @@ fn main() -> Result<()> {
|
|||||||
Some("f16") => DType::F16,
|
Some("f16") => DType::F16,
|
||||||
Some("bf16") => DType::BF16,
|
Some("bf16") => DType::BF16,
|
||||||
Some("f32") => DType::F32,
|
Some("f32") => DType::F32,
|
||||||
Some(dtype) => panic!("Unsupported dtype {dtype}"),
|
Some(dtype) => bail!("Unsupported dtype {dtype}"),
|
||||||
None => DType::F16,
|
None => DType::F16,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user