cogcorp commited on
Commit
5198954
·
1 Parent(s): 0e0b25b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -78,13 +78,13 @@ class SemanticSearch:
78
  return neighbors
79
 
80
  def get_text_embedding(self, texts, batch=1000):
81
- embeddings = []
82
- for i in range(0, len(texts), batch):
83
- text_batch = texts[i:(i+batch):
84
- emb_batch = self.use(text_batch)
85
- embeddings.append(emb_batch)
86
- embeddings = np.vstack(embeddings)
87
- return embeddings
88
 
89
 
90
  def load_recommender(path, start_page=1):
 
78
  return neighbors
79
 
80
  def get_text_embedding(self, texts, batch=1000):
81
+ embeddings = []
82
+ for i in range(0, len(texts), batch):
83
+ text_batch = texts[i:(i+batch)]
84
+ emb_batch = self.use(text_batch)
85
+ embeddings.append(emb_batch)
86
+ embeddings = np.vstack(embeddings)
87
+ return embeddings
88
 
89
 
90
  def load_recommender(path, start_page=1):