feature(tabby): automatically use the appropriate device based on the features

This commit is contained in:
boxbeam 2024-06-11 14:30:33 -04:00
parent 7a95cf671e
commit 6b296b1535

View File

@ -97,7 +97,11 @@ pub struct ServeArgs {
port: u16, port: u16,
/// Device to run model inference. /// Device to run model inference.
#[clap(long, default_value_t=Device::Cpu)] #[cfg_attr(feature = "vulkan", clap(long, default_value_t = Device::Vulkan))]
#[cfg_attr(feature = "metal", clap(long, default_value_t = Device::Metal))]
#[cfg_attr(feature = "cuda", clap(long, default_value_t = Device::Cuda))]
#[cfg_attr(feature = "rocm", clap(long, default_value_t = Device::Rocm))]
#[cfg_attr(not(any(feature = "vulkan", feature = "metal", feature = "cuda", feature = "rocm")), clap(long, default_value_t = Device::Cpu))]
device: Device, device: Device,
/// Device to run chat model [default equals --device arg] /// Device to run chat model [default equals --device arg]