Skip to content

Minor changes #798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion backend/src/QA_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,8 @@ def get_neo4j_retriever(graph, document_names,chat_mode_settings, score_threshol
def setup_chat(model, graph, document_names, chat_mode_settings):
start_time = time.time()
try:
model = "openai-gpt-4o" if model == "diffbot" else model
if model == "diffbot":
model = os.getenv('DEFAULT_DIFFBOT_CHAT_MODEL')

llm, model_name = get_llm(model=model)
logging.info(f"Model called in chat: {model} (version: {model_name})")
Expand Down
9 changes: 6 additions & 3 deletions backend/src/post_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,12 @@ def create_fulltext(driver,type):
for label in FILTER_LABELS:
if label in labels:
labels.remove(label)

labels_str = ":" + "|".join([f"`{label}`" for label in labels])
logging.info(f"Fetched labels in {time.time() - start_step:.2f} seconds.")
if labels:
labels_str = ":" + "|".join([f"`{label}`" for label in labels])
logging.info(f"Fetched labels in {time.time() - start_step:.2f} seconds.")
else:
logging.info("Full text index is not created as labels are empty")
return
except Exception as e:
logging.error(f"Failed to fetch labels: {e}")
return
Expand Down
4 changes: 2 additions & 2 deletions backend/src/shared/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@

collect {{
UNWIND nodes AS n
MATCH (n)-[:IN_COMMUNITY]->(c:__Community__)
OPTIONAL MATCH (n)-[:IN_COMMUNITY]->(c:__Community__)
WITH c, c.community_rank AS rank, c.weight AS weight
RETURN c
ORDER BY rank, weight DESC
Expand Down Expand Up @@ -477,7 +477,7 @@
}
] AS chunks,
[
community IN communities |
community IN communities WHERE community IS NOT NULL |
community {
.*,
embedding: null
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/ChatBot/ChatModeToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default function ChatModeToggle({
return isGdsActive && isCommunityAllowed
? AvailableModes
: AvailableModes?.filter(
(m) => !m.mode.includes(chatModeLables.entity_vector) && !m.mode.includes(chatModeLables.global_vector)
(m) => !m.mode.includes(chatModeLables.global_vector)
);
}, [isGdsActive, isCommunityAllowed]);
const menuItems = useMemo(() => {
Expand Down