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

@@ -97,3 +97,16 @@ class EmbeddingSmallOpenAI(Embedding):
__mapper_args__ = {
'polymorphic_identity': 'embedding_small_openai',
}
class EmbeddingLargeOpenAI(Embedding):
__tablename__ = 'embedding_large_openai'
id = db.Column(db.Integer, db.ForeignKey('embeddings.id'), primary_key=True)
# 3072 is the OpenAI Large Embedding dimension.
# If another embedding model is chosen, this dimension may need to be changed.
embedding = db.Column(Vector(3072), nullable=False)
__mapper_args__ = {
'polymorphic_identity': 'embedding_large_openai',
}