jugarte00 commited on
Commit
ba9f27d
·
verified ·
1 Parent(s): 9a45764

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. article_embedding/embed.py +3 -3
article_embedding/embed.py CHANGED
@@ -35,7 +35,7 @@ class StellaEmbedder(SentenceTransformerModel):
35
  "dunzhang/stella_en_400M_v5",
36
  trust_remote_code=True,
37
  config_kwargs={"use_memory_efficient_attention": False, "unpad_inputs": False},
38
- ).to("mps")
39
 
40
 
41
  class NvEmbedder(SentenceTransformerModel):
@@ -43,7 +43,7 @@ class NvEmbedder(SentenceTransformerModel):
43
  self.model = SentenceTransformer(
44
  "nvidia/NV-Embed-V2",
45
  trust_remote_code=True,
46
- ).to("mps")
47
  self.model.max_seq_length = 32768
48
  self.model.tokenizer.padding_side = "right"
49
 
@@ -63,7 +63,7 @@ class JasperEmbedder(SentenceTransformerModel):
63
  "is_text_encoder": True,
64
  "vector_dim": 1024,
65
  },
66
- ).to("mps")
67
  self.model.max_seq_length = 1024
68
 
69
  def embed(self, documents: list[str]) -> Any:
 
35
  "dunzhang/stella_en_400M_v5",
36
  trust_remote_code=True,
37
  config_kwargs={"use_memory_efficient_attention": False, "unpad_inputs": False},
38
+ )
39
 
40
 
41
  class NvEmbedder(SentenceTransformerModel):
 
43
  self.model = SentenceTransformer(
44
  "nvidia/NV-Embed-V2",
45
  trust_remote_code=True,
46
+ )
47
  self.model.max_seq_length = 32768
48
  self.model.tokenizer.padding_side = "right"
49
 
 
63
  "is_text_encoder": True,
64
  "vector_dim": 1024,
65
  },
66
+ )
67
  self.model.max_seq_length = 1024
68
 
69
  def embed(self, documents: list[str]) -> Any: