fix(): reset vectors similarity threshold

This commit is contained in:
gitgernit
2025-11-23 14:56:17 +03:00
parent 11d9feb888
commit 0e41a1210c
3 changed files with 11 additions and 7 deletions
+8 -4
View File
@@ -1,16 +1,20 @@
#!/bin/bash
DB_URL="${DATABASE_URL:-postgresql://user:password@localhost:5432/dbname}"
DUMP_FILE="${1:-dump_data.sql}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
DUMP_FILE="${1:-$PROJECT_ROOT/dumps/data_dump.sql}"
if [ ! -f "$DUMP_FILE" ]; then
echo "Ошибка: файл $DUMP_FILE не найден"
echo "Использование: $0 [путь_к_дампу]"
echo "По умолчанию: $PROJECT_ROOT/dumps/data_dump.sql"
exit 1
fi
echo "Импорт дампа из $DUMP_FILE в БД..."
DB_URL="${DATABASE_URL:-postgresql://postgres:postgres@localhost:5432/app}"
echo "Импорт дампа из $DUMP_FILE в БД $DB_URL..."
psql "$DB_URL" -f "$DUMP_FILE"
echo "Импорт завершен!"
@@ -22,7 +22,7 @@ class DefaultVacancyDataGateway(VacancyDataGateway):
statement = (
select(Vacancy, label("resume_similarity", similarity_expr))
.join(VacancyEmbedding, vacancy_embedding_table.c.vacancy_id == vacancy_table.c.id)
.where(similarity_expr >= 0.5)
.where(similarity_expr >= 0.0)
.order_by(distance_expr.asc())
.limit(100)
)
Generated
+2 -2
View File
@@ -2406,7 +2406,6 @@ dependencies = [
{ name = "fastapi" },
{ name = "levenshtein" },
{ name = "markupsafe" },
{ name = "prometheus-fastapi-instrumentator" },
{ name = "pydantic", extra = ["email"] },
{ name = "uuid-utils" },
{ name = "uvicorn" },
@@ -2420,6 +2419,7 @@ backend = [
{ name = "firebase-admin" },
{ name = "httpx" },
{ name = "pgvector" },
{ name = "prometheus-fastapi-instrumentator" },
{ name = "psycopg", extra = ["binary"] },
{ name = "python-multipart" },
{ name = "sqlalchemy" },
@@ -2482,7 +2482,6 @@ requires-dist = [
{ name = "fastapi", specifier = "==0.119.0" },
{ name = "levenshtein", specifier = ">=0.27.3" },
{ name = "markupsafe", git = "https://github.com/pallets/markupsafe?rev=3.0.2" },
{ name = "prometheus-fastapi-instrumentator", specifier = ">=7.1.0" },
{ name = "pydantic", extras = ["email"], specifier = ">=2.12.4" },
{ name = "uuid-utils", specifier = "==0.11.1" },
{ name = "uvicorn", specifier = "==0.37.0" },
@@ -2496,6 +2495,7 @@ backend = [
{ name = "firebase-admin", specifier = ">=7.1.0" },
{ name = "httpx", specifier = "==0.28.1" },
{ name = "pgvector", specifier = ">=0.4.1" },
{ name = "prometheus-fastapi-instrumentator", specifier = ">=7.1.0" },
{ name = "psycopg", extras = ["binary"], specifier = ">=3.2.12" },
{ name = "python-multipart", specifier = ">=0.0.20" },
{ name = "sqlalchemy", specifier = "==2.0.44" },