Skip to content

Commit

Permalink
changed internal data format of Similarity index of cfeature and remo…
Browse files Browse the repository at this point in the history
…ved using thread pool on writing feature vector to Similarity index object. (2)
  • Loading branch information
ryogrid committed Jan 25, 2025
1 parent 8ad9e13 commit 0643d28
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions gen_cfeatures.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,6 @@ def process_directory(self, dir_path: str, added_date: datetime.date | None = No
print('{:.4f} seconds per file'.format(time_per_file))
print("", flush=True)
last_cnt = cnt
self.cindex.save()

except Exception as e:
error_class: type = type(e)
Expand All @@ -414,17 +413,17 @@ def process_directory(self, dir_path: str, added_date: datetime.date | None = No
print_traceback()
continue

# wait for all tasks to be finished
for future in concurrent.futures.as_completed(future_to_vec):
try:
future.result()
except Exception as e:
error_class: type = type(e)
error_description: str = str(e)
err_msg: str = '%s: %s' % (error_class, error_description)
print(err_msg)
print_traceback()
continue
# # wait for all tasks to be finished
# for future in concurrent.futures.as_completed(future_to_vec):
# try:
# future.result()
# except Exception as e:
# error_class: type = type(e)
# error_description: str = str(e)
# err_msg: str = '%s: %s' % (error_class, error_description)
# print(err_msg)
# print_traceback()
# continue
#self.cindex.save('charactor-featues-idx')
self.cindex.save()

Expand Down

0 comments on commit 0643d28

Please sign in to comment.