mirror of
https://github.com/khoj-ai/khoj.git
synced 2025-02-20 06:55:08 +00: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
|
return config.setting
|
||||||
|
|
||||||
@staticmethod
|
@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()
|
config = await UserTextToImageModelConfig.objects.filter(user=user).prefetch_related("setting").afirst()
|
||||||
if not config:
|
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
|
return config.setting
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
Loading…
Add table
Reference in a new issue