Spaces:
Running
Running
Update database.py
Browse files- database.py +2 -1
database.py
CHANGED
@@ -4,11 +4,12 @@ from parser import parse_python_code
|
|
4 |
import os
|
5 |
from sklearn.metrics.pairwise import cosine_similarity
|
6 |
import numpy as np
|
|
|
7 |
|
8 |
# User-configurable variables
|
9 |
DB_NAME = "python_programs" # ChromaDB collection name
|
10 |
HF_DATASET_NAME = "python_program_vectors" # Hugging Face Dataset name
|
11 |
-
HF_TOKEN = "
|
12 |
PERSIST_DIR = "./chroma_data" # Directory for persistent storage (optional)
|
13 |
|
14 |
def init_chromadb(persist_dir=PERSIST_DIR):
|
|
|
4 |
import os
|
5 |
from sklearn.metrics.pairwise import cosine_similarity
|
6 |
import numpy as np
|
7 |
+
import dotenv
|
8 |
|
9 |
# User-configurable variables
|
10 |
DB_NAME = "python_programs" # ChromaDB collection name
|
11 |
HF_DATASET_NAME = "python_program_vectors" # Hugging Face Dataset name
|
12 |
+
HF_TOKEN = os.getenv("HF_KEY") # Replace with your Hugging Face API token
|
13 |
PERSIST_DIR = "./chroma_data" # Directory for persistent storage (optional)
|
14 |
|
15 |
def init_chromadb(persist_dir=PERSIST_DIR):
|