Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

added check for chip accelerators in chunking

matthew-heartfule29b22411b9e
diff --git a/screenpipe-server/src/chunking.rs b/screenpipe-server/src/chunking.rs
index 887a364f8..649fa3047 100644
--- a/screenpipe-server/src/chunking.rs
+++ b/screenpipe-server/src/chunking.rs
@@ -6,7 +6,9 @@ use hf_hub::{api::sync::Api, Repo, RepoType};
use tokenizers::Tokenizer;
pub async fn text_chunking_by_similarity(text: &str) -> Result<Vec<String>> {
- let device = Device::Cpu;
+ let device = Device::new_metal(0)
+ .unwrap_or_else(|_| Device::new_cuda(0)
+ .unwrap_or(Device::Cpu));
let repo = Repo::with_revision(
"jinaai/jina-embeddings-v2-base-en".to_string(),
RepoType::Model,