Added OpenAI large embedding / improve migration and upgrade handling for containers

This commit is contained in:
Josako
2024-07-04 17:20:02 +02:00
parent 8e1dac0233
commit c55fc6b7ce
90 changed files with 1032 additions and 48 deletions

View File

@@ -0,0 +1,34 @@
"""Add Embedding model for OpenAI large model
Revision ID: 5d5437d81041
Revises: d173cea8d204
Create Date: 2024-07-04 15:49:43.665685
"""
from alembic import op
import sqlalchemy as sa
import pgvector
# revision identifiers, used by Alembic.
revision = '5d5437d81041'
down_revision = 'd173cea8d204'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('embedding_large_openai',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('embedding', pgvector.sqlalchemy.Vector(dim=3072), nullable=False),
sa.ForeignKeyConstraint(['id'], ['embeddings.id'], ),
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('embedding_large_openai')
# ### end Alembic commands ###