mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Fix image generation on server -- use default config when not set by user
This commit is contained in:
parent
6fa2dbc042
commit
a129b017b9
1 changed files with 5 additions and 2 deletions
|
@ -918,10 +918,13 @@ class ConversationAdapters:
|
|||
return config.setting
|
||||
|
||||
@staticmethod
|
||||
async def aget_user_text_to_image_model(user: KhojUser):
|
||||
async def aget_user_text_to_image_model(user: KhojUser) -> Optional[TextToImageModelConfig]:
|
||||
config = await UserTextToImageModelConfig.objects.filter(user=user).prefetch_related("setting").afirst()
|
||||
if not config:
|
||||
return None
|
||||
default_config = await ConversationAdapters.aget_text_to_image_model_config()
|
||||
if not default_config:
|
||||
return None
|
||||
return default_config
|
||||
return config.setting
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue