mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 04:44:26 +01:00
Implement PR comments
This commit is contained in:
parent
1b90778bf5
commit
f692021bfc
@ -138,5 +138,5 @@ greek = ["charabia/greek"]
|
|||||||
# allow khmer specialized tokenization
|
# allow khmer specialized tokenization
|
||||||
khmer = ["charabia/khmer"]
|
khmer = ["charabia/khmer"]
|
||||||
|
|
||||||
# allow CUDA support
|
# allow CUDA support, see <https://github.com/meilisearch/meilisearch/issues/4306>
|
||||||
cuda = ["candle-core/cuda"]
|
cuda = ["candle-core/cuda"]
|
||||||
|
@ -70,7 +70,13 @@ impl std::fmt::Debug for Embedder {
|
|||||||
|
|
||||||
impl Embedder {
|
impl Embedder {
|
||||||
pub fn new(options: EmbedderOptions) -> std::result::Result<Self, NewEmbedderError> {
|
pub fn new(options: EmbedderOptions) -> std::result::Result<Self, NewEmbedderError> {
|
||||||
let device = candle_core::Device::cuda_if_available(0).unwrap();
|
let device = match candle_core::Device::cuda_if_available(0) {
|
||||||
|
Ok(device) => device,
|
||||||
|
Err(error) => {
|
||||||
|
log::warn!("could not initialize CUDA device for Hugging Face embedder, defaulting to CPU: {}", error);
|
||||||
|
candle_core::Device::Cpu
|
||||||
|
}
|
||||||
|
};
|
||||||
let repo = match options.revision.clone() {
|
let repo = match options.revision.clone() {
|
||||||
Some(revision) => Repo::with_revision(options.model.clone(), RepoType::Model, revision),
|
Some(revision) => Repo::with_revision(options.model.clone(), RepoType::Model, revision),
|
||||||
None => Repo::model(options.model.clone()),
|
None => Repo::model(options.model.clone()),
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
name = "xtask"
|
name = "xtask"
|
||||||
version.workspace = true
|
version.workspace = true
|
||||||
authors.workspace = true
|
authors.workspace = true
|
||||||
description.workspace = true
|
description = "Workspace automation tool following the xtask pattern <https://github.com/matklad/cargo-xtask>"
|
||||||
homepage.workspace = true
|
homepage.workspace = true
|
||||||
readme.workspace = true
|
readme.workspace = true
|
||||||
edition.workspace = true
|
edition.workspace = true
|
||||||
|
Loading…
Reference in New Issue
Block a user