mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-06 05:39:12 +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:
@@ -7,6 +7,7 @@ from database.models import (
|
||||
ChatModelOptions,
|
||||
OfflineChatProcessorConversationConfig,
|
||||
OpenAIProcessorConversationConfig,
|
||||
SearchModel,
|
||||
UserConversationConfig,
|
||||
Conversation,
|
||||
Subscription,
|
||||
@@ -71,6 +72,16 @@ class ConversationFactory(factory.django.DjangoModelFactory):
|
||||
user = factory.SubFactory(UserFactory)
|
||||
|
||||
|
||||
class SearchModelFactory(factory.django.DjangoModelFactory):
|
||||
class Meta:
|
||||
model = SearchModel
|
||||
|
||||
name = "default"
|
||||
model_type = "text"
|
||||
bi_encoder = "thenlper/gte-small"
|
||||
cross_encoder = "cross-encoder/ms-marco-MiniLM-L-6-v2"
|
||||
|
||||
|
||||
class SubscriptionFactory(factory.django.DjangoModelFactory):
|
||||
class Meta:
|
||||
model = Subscription
|
||||
|
||||
Reference in New Issue
Block a user