mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 13:20:17 +00:00
Make search model configurable on server
- Expose ability to modify search model via Django admin interface - Previously the bi_encoder and cross_encoder models to use were set in code - Now it's user configurable but with a default config generated by default
This commit is contained in:
32
src/database/migrations/0017_searchmodel.py
Normal file
32
src/database/migrations/0017_searchmodel.py
Normal file
@@ -0,0 +1,32 @@
|
||||
# Generated by Django 4.2.5 on 2023-11-14 23:25
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("database", "0016_alter_subscription_renewal_date"),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name="SearchModel",
|
||||
fields=[
|
||||
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
|
||||
("created_at", models.DateTimeField(auto_now_add=True)),
|
||||
("updated_at", models.DateTimeField(auto_now=True)),
|
||||
("name", models.CharField(default="default", max_length=200)),
|
||||
("model_type", models.CharField(choices=[("text", "Text")], default="text", max_length=200)),
|
||||
("bi_encoder", models.CharField(default="thenlper/gte-small", max_length=200)),
|
||||
(
|
||||
"cross_encoder",
|
||||
models.CharField(
|
||||
blank=True, default="cross-encoder/ms-marco-MiniLM-L-6-v2", max_length=200, null=True
|
||||
),
|
||||
),
|
||||
],
|
||||
options={
|
||||
"abstract": False,
|
||||
},
|
||||
),
|
||||
]
|
||||
Reference in New Issue
Block a user