Spaces:
Sleeping
Sleeping
Commit
·
8997990
1
Parent(s):
079558d
speed
Browse files
app.py
CHANGED
@@ -126,7 +126,7 @@ class RepLlamaModel:
|
|
126 |
model.eval()
|
127 |
return model
|
128 |
|
129 |
-
def encode(self, texts, batch_size=
|
130 |
self.model = self.model.cuda()
|
131 |
all_embeddings = []
|
132 |
for i in range(0, len(texts), batch_size):
|
@@ -183,7 +183,7 @@ def initialize_faiss_and_corpus(dataset_name):
|
|
183 |
logger.info(f"Initialized FAISS index and corpus lookups for {dataset_name}")
|
184 |
return index
|
185 |
|
186 |
-
def search_queries(dataset_name, q_reps, depth=
|
187 |
global faiss_index
|
188 |
logger.info(f"Searching queries. Shape of q_reps: {q_reps.shape}")
|
189 |
|
|
|
126 |
model.eval()
|
127 |
return model
|
128 |
|
129 |
+
def encode(self, texts, batch_size=48, **kwargs):
|
130 |
self.model = self.model.cuda()
|
131 |
all_embeddings = []
|
132 |
for i in range(0, len(texts), batch_size):
|
|
|
183 |
logger.info(f"Initialized FAISS index and corpus lookups for {dataset_name}")
|
184 |
return index
|
185 |
|
186 |
+
def search_queries(dataset_name, q_reps, depth=100):
|
187 |
global faiss_index
|
188 |
logger.info(f"Searching queries. Shape of q_reps: {q_reps.shape}")
|
189 |
|