Skip to content

SocialGouv/accords-entreprise

Repository files navigation

Assigner des thèmes aux accords d'entreprise

Environment

You might want to set the following env variables:

# POTGRES DB - Storage of embeddings, chunks, themes
export POSTGRES_USER="user"
export POSTGRES_PASSWORD="123456"
export POSTGRES_DB="company_agreements"

# SCALEWAY - if you are running embedding models on it
export SCALEWAY_API_KEY="<API_KEY>"
export SCALEWAY_BASE_URL="<URL>/v1"
export SCALEWAY_MODEL_NAME="baai/bge-multilingual-gemma2:fp32"

# OPENAI - if you are using its embedding models
export OPENAI_API_KEY="<API_KEY>"
export OPENAI_MODEL_NAME="text-embedding-3-large"

Docker PostgreSQL

docker-compose up -d
docker exec -it postgres-pgvector psql -U $POSTGRES_USER -d $POSTGRES_DB -c "\d"

Alembic

Init Alembic

# To update DB schemas
alembic revision --autogenerate -m "Initial migration"
# Open up the generated revision and fix imports that might be wrong (because of pgvector for example)

# To apply DB schemas
alembic upgrade head

Reset the DB and alembic entirely

# Delete all alembic versions
rm -rf tca/alembic/versions/*.py

# Drop the database
docker exec -it postgres-pgvector psql -U $POSTGRES_USER -d postgres -c "DROP DATABASE $POSTGRES_DB;"

# Create the database again
docker exec -it postgres-pgvector psql -U $POSTGRES_USER -d postgres -c "CREATE DATABASE $POSTGRES_DB;"

# Run `scripts/init.sql` against the PostgreSQL DB in the Docker container:
docker exec -i postgres-pgvector psql -U $POSTGRES_USER -d $POSTGRES_DB -f docker-entrypoint-initdb.d/init.sql

Then re-run Init Alembic

Embeddings

Using Ollama locally

ollama pull bge-m3:567m-fp16

Scripts

Ingest documents

make ingest-docs

Ingest themes

make ingest-themes

Theming

make run-theming

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published