Skip to content

Commit 04d5533

Browse files
committed
bugfix: crash when init
1 parent 1d9cb5b commit 04d5533

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ def __init__(self, config):
1818
config['index_path'],
1919
config['model_path'],
2020
)
21+
self.check_env()
22+
23+
24+
def check_env(self):
25+
if not os.path.exists(self.exists_index_path):
26+
parent_path = os.path.join(self.exists_index_path, os.pardir)
27+
os.makedirs(os.path.abspath(parent_path), exist_ok=True)
28+
with open(self.exists_index_path, 'w') as wp:
29+
wp.write("[]")
2130

2231

2332
def get_exists_index(self):

0 commit comments

Comments
 (0)