From 4bb995c2a3fed89a8ee1cdbff2fa653505b5001e Mon Sep 17 00:00:00 2001 From: Seohyun Lee Date: Mon, 5 Aug 2024 16:55:04 +0900 Subject: [PATCH] fix: fix refer --- frontend/src/lib/ChatBox.svelte | 52 +++++++++++++++++++++++---------- frontend/src/utils/api.ts | 2 +- server/paper_handler.py | 4 +-- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/ChatBox.svelte b/frontend/src/lib/ChatBox.svelte index c53b1b8..15647eb 100644 --- a/frontend/src/lib/ChatBox.svelte +++ b/frontend/src/lib/ChatBox.svelte @@ -1,14 +1,16 @@
{#if true} -
-
- - -
+ +
+
+ + +
참고할 목록
+ + {#each data.list || [] as item} + + {/each} + +
+ +
+
{/if}
diff --git a/frontend/src/utils/api.ts b/frontend/src/utils/api.ts index e077168..15ee742 100644 --- a/frontend/src/utils/api.ts +++ b/frontend/src/utils/api.ts @@ -3,7 +3,7 @@ import {tick} from "svelte"; //@ts-ignore import {get_current_component} from "svelte/internal"; -export const endpoint = import.meta.env.DEV ? 'http://localhost:8000' : 'https://api-naddal.seorii.page' +export const endpoint = import.meta.env.DEV ? 'http://localhost:80' : 'https://api-naddal.seorii.page' export default function api(path: string, data: any = undefined, method = 'POST'): Promise { if (!browser) return new Promise<{ data: any }>(() => null) diff --git a/server/paper_handler.py b/server/paper_handler.py index d42c241..49cecb5 100644 --- a/server/paper_handler.py +++ b/server/paper_handler.py @@ -115,7 +115,7 @@ def chat(chat_request: ChatRequest): question = chat_request.body chat_log = get_or_create_chat_log(chat_id, question) target_ids = [f"id{id}" for id in chat_request.refer] - # inference_result = inference(question=question, embedding_names=target_ids) - inference_result = "This is model's response" + inference_result = inference(question=question, embedding_names=target_ids) + # inference_result = "This is model's response" update(chat_log, chat_id, question, inference_result) return inference_result