- Remove embedding model from Catalog. We use Mistral's embedding.
This commit is contained in:
@@ -12,8 +12,6 @@ class Catalog(db.Model):
|
||||
description = db.Column(db.Text, nullable=True)
|
||||
type = db.Column(db.String(50), nullable=False, default="STANDARD_CATALOG")
|
||||
|
||||
embedding_model = db.Column(db.String(50), nullable=True)
|
||||
|
||||
min_chunk_size = db.Column(db.Integer, nullable=True, default=1500)
|
||||
max_chunk_size = db.Column(db.Integer, nullable=True, default=2500)
|
||||
|
||||
|
||||
@@ -32,8 +32,6 @@ class CatalogForm(FlaskForm):
|
||||
type = SelectField('Catalog Type', validators=[DataRequired()])
|
||||
|
||||
# Selection fields for processing & creating embeddings
|
||||
embedding_model = SelectField('Embedding Model', choices=[], validators=[DataRequired()])
|
||||
|
||||
min_chunk_size = IntegerField('Minimum Chunk Size (1500)', validators=[NumberRange(min=0), Optional()],
|
||||
default=1500)
|
||||
max_chunk_size = IntegerField('Maximum Chunk Size (2500)', validators=[NumberRange(min=0), Optional()],
|
||||
@@ -47,7 +45,6 @@ class CatalogForm(FlaskForm):
|
||||
super().__init__(*args, **kwargs)
|
||||
# Dynamically populate the 'type' field using the constructor
|
||||
self.type.choices = [(key, value['name']) for key, value in CATALOG_TYPES.items()]
|
||||
self.embedding_model.choices = [(model, model) for model in current_app.config['SUPPORTED_EMBEDDINGS']]
|
||||
|
||||
|
||||
class EditCatalogForm(DynamicFormBase):
|
||||
@@ -58,8 +55,6 @@ class EditCatalogForm(DynamicFormBase):
|
||||
type = StringField('Catalog Type', validators=[DataRequired()], render_kw={'readonly': True})
|
||||
|
||||
# Selection fields for processing & creating embeddings
|
||||
embedding_model = StringField('Embedding Model', validators=[DataRequired()], render_kw={'readonly': True})
|
||||
|
||||
min_chunk_size = IntegerField('Minimum Chunk Size (2000)', validators=[NumberRange(min=0), Optional()],
|
||||
default=2000)
|
||||
max_chunk_size = IntegerField('Maximum Chunk Size (3000)', validators=[NumberRange(min=0), Optional()],
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
"""Remove embedding model from Catalog - we use Mistral
|
||||
|
||||
Revision ID: ed981a641be9
|
||||
Revises: 2b04e961eee4
|
||||
Create Date: 2025-03-07 14:02:49.027216
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import pgvector
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ed981a641be9'
|
||||
down_revision = '2b04e961eee4'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('catalog', 'embedding_model')
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('catalog', sa.Column('embedding_model', sa.VARCHAR(length=50), autoincrement=False, nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user