clean up annoy warning in predict.py

This commit is contained in:
Jeff Raubitschek 2019-09-24 23:40:56 -07:00
Родитель 37a0c58581
Коммит 386a402e3f
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -111,7 +111,7 @@ if __name__ == '__main__':
indexes = [{'code_tokens': d['function_tokens'], 'language': d['language']} for d in tqdm(definitions)] indexes = [{'code_tokens': d['function_tokens'], 'language': d['language']} for d in tqdm(definitions)]
code_representations = model.get_code_representations(indexes) code_representations = model.get_code_representations(indexes)
indices = AnnoyIndex(code_representations[0].shape[0]) indices = AnnoyIndex(code_representations[0].shape[0], 'angular')
for index, vector in tqdm(enumerate(code_representations)): for index, vector in tqdm(enumerate(code_representations)):
if vector is not None: if vector is not None:
indices.add_item(index, vector) indices.add_item(index, vector)