Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions libs/ktem/ktem/pages/chat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import json
import logging
import re
from copy import deepcopy
from typing import Optional
Expand Down Expand Up @@ -1368,7 +1369,15 @@ def chat_fn(
)

def check_and_suggest_name_conv(self, chat_history):
suggest_pipeline = SuggestConvNamePipeline()
try:
suggest_pipeline = SuggestConvNamePipeline()
except Exception as e:
logging.warning(
f"Failed to initialize SuggestConvNamePipeline: {e}. "
"Skipping conversation name suggestion."
)
return gr.update(), False

new_name = gr.update()
renamed = False

Expand All @@ -1395,7 +1404,15 @@ def suggest_chat_conv(
else settings["reasoning.lang"]
)
if use_suggestion:
suggest_pipeline = SuggestFollowupQuesPipeline()
try:
suggest_pipeline = SuggestFollowupQuesPipeline()
except Exception as e:
logging.warning(
f"Failed to initialize SuggestFollowupQuesPipeline: {e}. "
"Skipping follow-up question suggestion."
)
return gr.update(visible=False), gr.update()

suggest_pipeline.lang = SUPPORTED_LANGUAGE_MAP.get(
target_language, "English"
)
Expand Down