Skip to content

Commit 2ee9d70

Browse files
authored
Merge pull request #469 from stacklok/prep-flags
Align flags with main app and rename files archive
2 parents 4a6aec0 + 9372d81 commit 2ee9d70

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

Diff for: .github/workflows/import_packages.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
github_token: ${{ github.token }}
5252
workflow: ".github/workflows/import_packages.yml"
5353
workflow_conclusion: success
54-
name: sqlite_vectordb_file
54+
name: sqlite_data
5555
path: /tmp/
5656
name_is_regexp: true
5757
skip_unpack: false
@@ -71,11 +71,11 @@ jobs:
7171
7272
- name: 'Run import_packages.py with poetry'
7373
run: |
74-
poetry run python scripts/import_packages.py --jsonl-dir /tmp/jsonl-files --db-path /tmp/sqlite_data/vectordb.db
74+
poetry run python scripts/import_packages.py --jsonl-dir /tmp/jsonl-files --vec-db-path /tmp/sqlite_data/vectordb.db
7575
7676
- name: 'Upload SQLite Vector DB File'
7777
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4
7878
with:
79-
name: sqlite_vectordb_file
79+
name: sqlite_data
8080
path: /tmp/sqlite_data/vectordb.db
8181
retention-days: 90

Diff for: scripts/import_packages.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212

1313

1414
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
1818
self.json_files = [
1919
os.path.join(jsonl_dir, "archived.jsonl"),
2020
os.path.join(jsonl_dir, "deprecated.jsonl"),
@@ -25,7 +25,7 @@ def __init__(self, jsonl_dir="data", db_path="./sqlite_data/vectordb.db"):
2525
self.model_path = "./codegate_volume/models/all-minilm-L6-v2-q5_k_m.gguf"
2626

2727
def _get_connection(self):
28-
conn = sqlite3.connect(self.db_path)
28+
conn = sqlite3.connect(self.vec_db_path)
2929
conn.enable_load_extension(True)
3030
sqlite_vec_sl_tmp.load(conn)
3131
conn.enable_load_extension(False)
@@ -129,12 +129,12 @@ def __del__(self):
129129
help="Directory containing JSONL files. Default is 'data'.",
130130
)
131131
parser.add_argument(
132-
"--db-path",
132+
"--vec-db-path",
133133
type=str,
134134
default="./sqlite_data/vectordb.db",
135135
help="Path to SQLite database file. Default is './sqlite_data/vectordb.db'.",
136136
)
137137
args = parser.parse_args()
138138

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)
140140
asyncio.run(importer.run_import())

0 commit comments

Comments
 (0)