From 3744bb8c1b021c465b56a034e0c6904213c3ec00 Mon Sep 17 00:00:00 2001 From: WenjiaoYue Date: Mon, 11 Nov 2024 09:10:12 +0800 Subject: [PATCH] Fix docSum ui error in accessing parsed files (#1079) Signed-off-by: Xinyao Wang Signed-off-by: ZePan110 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: chen, suyue Co-authored-by: Neo Zhang Jianyu Co-authored-by: ZhangJianyu Co-authored-by: XinyaoWa Co-authored-by: ZePan110 --- DocSum/docker_compose/intel/hpu/gaudi/compose.yaml | 1 + DocSum/tests/test_compose_on_gaudi.sh | 2 +- DocSum/tests/test_compose_on_xeon.sh | 2 +- DocSum/ui/svelte/src/lib/shared/Network.ts | 7 ++++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/DocSum/docker_compose/intel/hpu/gaudi/compose.yaml b/DocSum/docker_compose/intel/hpu/gaudi/compose.yaml index e9f3a96f8..ec9a2b355 100644 --- a/DocSum/docker_compose/intel/hpu/gaudi/compose.yaml +++ b/DocSum/docker_compose/intel/hpu/gaudi/compose.yaml @@ -8,6 +8,7 @@ services: ports: - "8008:80" environment: + HABANA_VISIBLE_DEVICES: all no_proxy: ${no_proxy} http_proxy: ${http_proxy} https_proxy: ${https_proxy} diff --git a/DocSum/tests/test_compose_on_gaudi.sh b/DocSum/tests/test_compose_on_gaudi.sh index 9c9ca92a0..305b56d5d 100644 --- a/DocSum/tests/test_compose_on_gaudi.sh +++ b/DocSum/tests/test_compose_on_gaudi.sh @@ -169,7 +169,7 @@ function main() { validate_microservices validate_megaservice - #validate_frontend + validate_frontend stop_docker echo y | docker system prune diff --git a/DocSum/tests/test_compose_on_xeon.sh b/DocSum/tests/test_compose_on_xeon.sh index fbd6797f5..7f0b2f8c5 100644 --- a/DocSum/tests/test_compose_on_xeon.sh +++ b/DocSum/tests/test_compose_on_xeon.sh @@ -168,7 +168,7 @@ function main() { validate_microservices validate_megaservice - #validate_frontend + validate_frontend stop_docker echo y | docker system prune diff --git a/DocSum/ui/svelte/src/lib/shared/Network.ts b/DocSum/ui/svelte/src/lib/shared/Network.ts index 172b25a44..705019c89 100644 --- a/DocSum/ui/svelte/src/lib/shared/Network.ts +++ b/DocSum/ui/svelte/src/lib/shared/Network.ts @@ -20,7 +20,12 @@ export async function fetchTextStream(query: string | Blob, params: string, file const url = `${DOC_BASE_URL}`; // Ensure the URL is constructed correctly const formData = new FormData(); - if (params === "doc_id" && file) { + if (!file) { + file = new Blob([""], { type: "text/plain" }); + fileName = "empty.txt"; + } + + if (params === "doc_id") { formData.append("files", file, fileName); formData.append("messages", query); } else if (params === "text") {