Last active
April 21, 2021 12:47
-
-
Save shamanez/1240f7084310e9c059a458e76093515a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if isOtherThreadIndexBusy: | |
if not threadHandle_index.is_alive(): | |
saved_dataset_shards=[] | |
for address in data_shard_addressses: | |
saved_dataset_shards.append(load_from_disk(address)) | |
concat=concatenate_datasets(saved_dataset_shards) | |
concat.save_to_disk(self.config.passages_path) | |
print("done saving the dataset to the passage_path") | |
#initializing the RAY workers with newly computed embeddings and index | |
self.trainer.model.module.module.model.rag.retriever.set_new_index() | |
self.trainer.model.module.module.model.rag.retriever.init_retrieval() | |
print("done loading the new index") | |
isEmUpdateBusy = False | |
isOtherThreadIndexBusy =False | |
isAddIndexBusy=False | |
self.trainer.accelerator_connector.accelerator.barrier("barrier") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment