File size: 485 Bytes
0fb0a80
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from pathlib import Path
import sys
import os

all_args_str = ' '.join(sys.argv[1:])

target_pathes = list(Path("./embs/").glob("**/*.npz"))
target_pathes = list(map(lambda x: x.parent, target_pathes))
# unique
target_pathes = list(set(target_pathes))

for target_path in target_pathes:
    name = target_path.parent.stem
    target = target_path.stem
    cmd = f"python embs_to_faiss.py -t {target} -i {name} {all_args_str}"
    print(f"[run] {cmd}")
    os.system(cmd)
    print("")