12
12
13
13
14
14
class PackageImporter :
15
- def __init__ (self , jsonl_dir = "data" , db_path = "./sqlite_data/vectordb.db" ):
16
- os .makedirs (os .path .dirname (db_path ), exist_ok = True )
17
- self .db_path = db_path
15
+ def __init__ (self , jsonl_dir = "data" , vec_db_path = "./sqlite_data/vectordb.db" ):
16
+ os .makedirs (os .path .dirname (vec_db_path ), exist_ok = True )
17
+ self .vec_db_path = vec_db_path
18
18
self .json_files = [
19
19
os .path .join (jsonl_dir , "archived.jsonl" ),
20
20
os .path .join (jsonl_dir , "deprecated.jsonl" ),
@@ -25,7 +25,7 @@ def __init__(self, jsonl_dir="data", db_path="./sqlite_data/vectordb.db"):
25
25
self .model_path = "./codegate_volume/models/all-minilm-L6-v2-q5_k_m.gguf"
26
26
27
27
def _get_connection (self ):
28
- conn = sqlite3 .connect (self .db_path )
28
+ conn = sqlite3 .connect (self .vec_db_path )
29
29
conn .enable_load_extension (True )
30
30
sqlite_vec_sl_tmp .load (conn )
31
31
conn .enable_load_extension (False )
@@ -129,12 +129,12 @@ def __del__(self):
129
129
help = "Directory containing JSONL files. Default is 'data'." ,
130
130
)
131
131
parser .add_argument (
132
- "--db-path" ,
132
+ "--vec- db-path" ,
133
133
type = str ,
134
134
default = "./sqlite_data/vectordb.db" ,
135
135
help = "Path to SQLite database file. Default is './sqlite_data/vectordb.db'." ,
136
136
)
137
137
args = parser .parse_args ()
138
138
139
- importer = PackageImporter (jsonl_dir = args .jsonl_dir , db_path = args .db_path )
139
+ importer = PackageImporter (jsonl_dir = args .jsonl_dir , vec_db_path = args .vec_db_path )
140
140
asyncio .run (importer .run_import ())
0 commit comments