From f80a90dca949019ac8701c7b52cca024d096b09a Mon Sep 17 00:00:00 2001 From: Jojo Ortiz Date: Tue, 21 Nov 2023 16:48:32 -0800 Subject: [PATCH 1/7] remove set feedback to false for RagChatbot --- pykoi/frontend/src/lib/Chatbots/Chat.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pykoi/frontend/src/lib/Chatbots/Chat.svelte b/pykoi/frontend/src/lib/Chatbots/Chat.svelte index dfd3650..43a2fb2 100644 --- a/pykoi/frontend/src/lib/Chatbots/Chat.svelte +++ b/pykoi/frontend/src/lib/Chatbots/Chat.svelte @@ -13,7 +13,7 @@ {/if} {#if feedback === "rag"} - + {/if} {#if feedback === "rank"} From 008ab8d2e66f5fd9a4c5896422ce7ef4b2676f66 Mon Sep 17 00:00:00 2001 From: Jojo Ortiz Date: Tue, 21 Nov 2023 16:49:08 -0800 Subject: [PATCH 2/7] update width to 100% --- pykoi/frontend/src/lib/Chatbots/Components/Answer.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/pykoi/frontend/src/lib/Chatbots/Components/Answer.svelte b/pykoi/frontend/src/lib/Chatbots/Components/Answer.svelte index 84bfea3..31317ec 100644 --- a/pykoi/frontend/src/lib/Chatbots/Components/Answer.svelte +++ b/pykoi/frontend/src/lib/Chatbots/Components/Answer.svelte @@ -67,6 +67,7 @@ text-align: left; padding: 10px; border: 1px solid var(--black); + width: 100%; } .small-button { margin-left: 10px; From 3afc0835d40fab0ecc3630c9317e0e127ecb03d0 Mon Sep 17 00:00:00 2001 From: Jojo Ortiz Date: Tue, 21 Nov 2023 16:50:36 -0800 Subject: [PATCH 3/7] add funtionality to close dropdown after outside click --- .../lib/Chatbots/Components/Dropdown.svelte | 9 ++++++++- pykoi/frontend/src/utils.js | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte b/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte index a9dee91..1855c12 100644 --- a/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte +++ b/pykoi/frontend/src/lib/Chatbots/Components/Dropdown.svelte @@ -3,6 +3,7 @@ import { checkedDocs } from "../../../store"; import { selectAll } from "d3-selection"; import { tooltip } from "../../../utils.js"; + import { clickOutside } from "../../../utils.js"; export let documents = []; @@ -44,12 +45,18 @@ return text; } + function handleClickOutside(e) { + e.preventDefault(); + console.log('click outside'); + expanded = false; + } + $: console.log($checkedDocs);
-
+
- +

These are the files your model will use as context.

+
+
+ +
+
+ + Drag and drop files here +
+
{#if indexing && !indexed}

{dots}

{/if} {#if indexed}

Data Successfully indexed!

{/if} -

These are the files your model will use as context.

-

Currently pdf, txt, and md are supported.

+

Currently pdf, txt, and md are supported.

@@ -100,6 +136,17 @@ From 071e791e38d11f7b52fa6a5919fbf9f9950b2dd7 Mon Sep 17 00:00:00 2001 From: Jojo Ortiz Date: Tue, 21 Nov 2023 16:55:57 -0800 Subject: [PATCH 7/7] remove Feedback/Dashboard component from huggingface demo --- example/retrieval_qa/retrieval_qa_huggingface_demo.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/example/retrieval_qa/retrieval_qa_huggingface_demo.py b/example/retrieval_qa/retrieval_qa_huggingface_demo.py index 44fef26..90f0f44 100644 --- a/example/retrieval_qa/retrieval_qa_huggingface_demo.py +++ b/example/retrieval_qa/retrieval_qa_huggingface_demo.py @@ -20,8 +20,8 @@ # "HuggingFaceH4/zephyr-7b-beta" # "meta-llama/Llama-2-7b-chat-hf" # "mistralai/Mistral-7B-v0.1" - # "databricks/dolly-v2-3b" - + # "databricks/dolly-v2-3b" + RETRIEVAL_MODEL = os.getenv("RETRIEVAL_MODEL") @@ -55,7 +55,7 @@ def main(**kwargs): # retrieval, chatbot, and dashboard pykoi components retriever = RetrievalQA(retrieval_model=retrieval_model, vector_db=vector_db, feedback="rag") chatbot = Chatbot(None, feedback="rag", is_retrieval=True) - dashboard = Dashboard(RAGDatabase(), feedback="rag") + # dashboard = Dashboard(RAGDatabase(), feedback="rag") ############################################################ # Starting the application and retrieval qa as a component # @@ -64,8 +64,7 @@ def main(**kwargs): app = Application(debug=False, share=False) app.add_component(retriever) app.add_component(chatbot) - app.add_component(dashboard) - print("RUNNING APP IN DEMO MODE") + # app.add_component(dashboard) app.run()