derek-thomas HF staff commited on
Commit
8ea4cbd
1 Parent(s): 8b15eea

Adding zero scaling :)

Browse files
Files changed (1) hide show
  1. backend/semantic_search.py +2 -0
backend/semantic_search.py CHANGED
@@ -4,6 +4,7 @@ import time
4
 
5
  import lancedb
6
  from sentence_transformers import SentenceTransformer
 
7
 
8
 
9
  # Setting up the logging
@@ -28,6 +29,7 @@ name="sentence-transformers/paraphrase-multilingual-minilm-l12-v2"
28
  st_model = SentenceTransformer(name, device='cuda')
29
 
30
  # used for both training and querying
 
31
  def embed_func(query):
32
  return st_model.encode(query)
33
 
 
4
 
5
  import lancedb
6
  from sentence_transformers import SentenceTransformer
7
+ import spaces
8
 
9
 
10
  # Setting up the logging
 
29
  st_model = SentenceTransformer(name, device='cuda')
30
 
31
  # used for both training and querying
32
+ @spaces.GPU
33
  def embed_func(query):
34
  return st_model.encode(query)
35