Spaces:
Running
Running
Add DATASET_ERROR_LOGS_PATH to settings for error logging functionality
Browse files- app.py +5 -7
- config/settings.py +1 -0
app.py
CHANGED
|
@@ -15,10 +15,11 @@ from config.settings import (
|
|
| 15 |
ACTIVE_MODEL,
|
| 16 |
EMBEDDING_MODEL,
|
| 17 |
DATASET_ID,
|
| 18 |
-
DATASET_CHAT_HISTORY_PATH,
|
| 19 |
-
DATASET_VECTOR_STORE_PATH,
|
| 20 |
DEFAULT_MODEL,
|
| 21 |
-
API_CONFIG
|
|
|
|
| 22 |
)
|
| 23 |
from src.knowledge_base.vector_store import create_vector_store, load_vector_store
|
| 24 |
from web.training_interface import (
|
|
@@ -1177,10 +1178,7 @@ with gr.Blocks() as demo:
|
|
| 1177 |
|
| 1178 |
# Launch application
|
| 1179 |
if __name__ == "__main__":
|
| 1180 |
-
#
|
| 1181 |
-
os.makedirs(ERROR_LOGS_PATH, exist_ok=True)
|
| 1182 |
-
|
| 1183 |
-
# Check knowledge base availability in dataset
|
| 1184 |
if not load_vector_store():
|
| 1185 |
logger.warning("Knowledge base not found. Please create it through the interface.")
|
| 1186 |
|
|
|
|
| 15 |
ACTIVE_MODEL,
|
| 16 |
EMBEDDING_MODEL,
|
| 17 |
DATASET_ID,
|
| 18 |
+
DATASET_CHAT_HISTORY_PATH,
|
| 19 |
+
DATASET_VECTOR_STORE_PATH,
|
| 20 |
DEFAULT_MODEL,
|
| 21 |
+
API_CONFIG,
|
| 22 |
+
DATASET_ERROR_LOGS_PATH # добавляем импорт
|
| 23 |
)
|
| 24 |
from src.knowledge_base.vector_store import create_vector_store, load_vector_store
|
| 25 |
from web.training_interface import (
|
|
|
|
| 1178 |
|
| 1179 |
# Launch application
|
| 1180 |
if __name__ == "__main__":
|
| 1181 |
+
# Проверяем knowledge base
|
|
|
|
|
|
|
|
|
|
| 1182 |
if not load_vector_store():
|
| 1183 |
logger.warning("Knowledge base not found. Please create it through the interface.")
|
| 1184 |
|
config/settings.py
CHANGED
|
@@ -26,6 +26,7 @@ DATASET_CHAT_HISTORY_PATH = "chat_history"
|
|
| 26 |
DATASET_VECTOR_STORE_PATH = "vector_store"
|
| 27 |
DATASET_FINE_TUNED_PATH = "fine_tuned_models"
|
| 28 |
DATASET_ANNOTATIONS_PATH = "annotations"
|
|
|
|
| 29 |
|
| 30 |
# Local paths (temporary storage)
|
| 31 |
CHAT_HISTORY_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "chat_history")
|
|
|
|
| 26 |
DATASET_VECTOR_STORE_PATH = "vector_store"
|
| 27 |
DATASET_FINE_TUNED_PATH = "fine_tuned_models"
|
| 28 |
DATASET_ANNOTATIONS_PATH = "annotations"
|
| 29 |
+
DATASET_ERROR_LOGS_PATH = "error_logs" # добавляем путь для логов
|
| 30 |
|
| 31 |
# Local paths (temporary storage)
|
| 32 |
CHAT_HISTORY_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "chat_history")
|