change
Browse files- api_service.py +1 -1
- dockerfile +1 -1
- main.py +2 -2
api_service.py
CHANGED
@@ -24,7 +24,7 @@ TOGETHER_API_KEY = os.getenv("TOGETHER_API_KEY")
|
|
24 |
if not TOGETHER_API_KEY:
|
25 |
raise ValueError("TOGETHER_API_KEY environment variable not set. Please check your .env file.")
|
26 |
|
27 |
-
VECTOR_DB_DIR = "vector_db_chroma"
|
28 |
COLLECTION_NAME = "my_instrument_manual_chunks"
|
29 |
|
30 |
LLM_MODEL_NAME = "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
|
|
|
24 |
if not TOGETHER_API_KEY:
|
25 |
raise ValueError("TOGETHER_API_KEY environment variable not set. Please check your .env file.")
|
26 |
|
27 |
+
VECTOR_DB_DIR = os.getenv("VECTOR_DB_DIR", "/data/vector_db_chroma")
|
28 |
COLLECTION_NAME = "my_instrument_manual_chunks"
|
29 |
|
30 |
LLM_MODEL_NAME = "meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo"
|
dockerfile
CHANGED
@@ -19,7 +19,7 @@ RUN pip install --upgrade pip && pip install -r requirements.txt
|
|
19 |
|
20 |
# 複製所有檔案(包含 build/ 資料夾)
|
21 |
COPY . .
|
22 |
-
|
23 |
# ✅ 如果你已經事先有 build/,這行可以省略:
|
24 |
# RUN cd frontend && npm install && npm run build
|
25 |
|
|
|
19 |
|
20 |
# 複製所有檔案(包含 build/ 資料夾)
|
21 |
COPY . .
|
22 |
+
RUN mkdir -p /data
|
23 |
# ✅ 如果你已經事先有 build/,這行可以省略:
|
24 |
# RUN cd frontend && npm install && npm run build
|
25 |
|
main.py
CHANGED
@@ -19,7 +19,7 @@ load_dotenv()
|
|
19 |
# --- Configuration ---
|
20 |
db_directory = "database"
|
21 |
db_path = os.path.join(db_directory, "processed_documents.db")
|
22 |
-
|
23 |
collection_name = "my_instrument_manual_chunks"
|
24 |
|
25 |
# Ensure TOGETHER_API_KEY is set
|
@@ -51,7 +51,7 @@ try:
|
|
51 |
)
|
52 |
|
53 |
# Instantiate ChromaDB client and load the collection
|
54 |
-
client = chromadb.PersistentClient(path=
|
55 |
vectorstore = Chroma(
|
56 |
client=client,
|
57 |
collection_name=collection_name,
|
|
|
19 |
# --- Configuration ---
|
20 |
db_directory = "database"
|
21 |
db_path = os.path.join(db_directory, "processed_documents.db")
|
22 |
+
VECTOR_DB_DIR = os.getenv("VECTOR_DB_DIR", "/data/vector_db_chroma")
|
23 |
collection_name = "my_instrument_manual_chunks"
|
24 |
|
25 |
# Ensure TOGETHER_API_KEY is set
|
|
|
51 |
)
|
52 |
|
53 |
# Instantiate ChromaDB client and load the collection
|
54 |
+
client = chromadb.PersistentClient(path=VECTOR_DB_DIR)
|
55 |
vectorstore = Chroma(
|
56 |
client=client,
|
57 |
collection_name=collection_name,
|