Spaces:
Build error
Build error
Commit Β·
42dd69b
1
Parent(s): b8dfa9f
Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ def get_first_subword(word):
|
|
| 31 |
except:
|
| 32 |
return tokenizer(word, add_special_tokens=False)['input_ids'][0]
|
| 33 |
|
| 34 |
-
def search(token_to_lookup, num_neighbors=
|
| 35 |
i = get_first_subword(token_to_lookup)
|
| 36 |
_ , I = index_L2_unnormalized.search(unnormalized_input_embeddings[i:i+1], num_neighbors)
|
| 37 |
hits = lookup_table.take(I[0])
|
|
|
|
| 31 |
except:
|
| 32 |
return tokenizer(word, add_special_tokens=False)['input_ids'][0]
|
| 33 |
|
| 34 |
+
def search(token_to_lookup, num_neighbors=500):
|
| 35 |
i = get_first_subword(token_to_lookup)
|
| 36 |
_ , I = index_L2_unnormalized.search(unnormalized_input_embeddings[i:i+1], num_neighbors)
|
| 37 |
hits = lookup_table.take(I[0])
|