From 27e6cac4ab559f5f82cba1fc6370df143662535d Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 4 Mar 2025 11:16:03 +0800 Subject: [PATCH] fix: csvTemplate error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1052711 --user=王孝刚 【知识库】英文模式-文档-QA问答对-下载的csv模版内容错误 https://www.tapd.cn/57709429/s/1661565 --- apps/dataset/serializers/document_serializers.py | 2 +- apps/dataset/template/csv_template_en.csv | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/apps/dataset/serializers/document_serializers.py b/apps/dataset/serializers/document_serializers.py index 963c033d4..e7a40b771 100644 --- a/apps/dataset/serializers/document_serializers.py +++ b/apps/dataset/serializers/document_serializers.py @@ -248,7 +248,7 @@ class DocumentSerializers(ApiMixin, serializers.Serializer): "rb") content = file.read() file.close() - return HttpResponse(content, status=200, headers={'Content-Type': 'text/cxv', + return HttpResponse(content, status=200, headers={'Content-Type': 'text/csv', 'Content-Disposition': 'attachment; filename="csv_template.csv"'}) elif self.data.get('type') == 'excel': file = open(os.path.join(PROJECT_DIR, "apps", "dataset", 'template', diff --git a/apps/dataset/template/csv_template_en.csv b/apps/dataset/template/csv_template_en.csv index 6e4601f15..6229449c8 100644 --- a/apps/dataset/template/csv_template_en.csv +++ b/apps/dataset/template/csv_template_en.csv @@ -1,8 +1,5 @@ -Section title (optional), Section content (required, question answer, no more than 4096 characters)), question (optional, one per line in the cell) -MaxKB product introduction, "MaxKB is a knowledge base question and answer system based on the LLM large language model. MaxKB = Max Knowledge Base aims to become the most powerful brain of the enterprise. -Out-of-the-box: Supports direct uploading of documents, automatic crawling of online documents, automatic text splitting and vectorization, and a good intelligent Q&A interactive experience; -Seamless embedding: Supports rapid embedding into third-party business systems with zero coding; -Multi-model support: Supports docking with mainstream large models, including Ollama local private large models (such as Llama 2, Llama 3, qwen), Tongyi Qianwen, OpenAI, Azure OpenAI, Kimi, Zhipu AI, iFlytek Spark and Baidu Qianfan Large models etc. ","What is MaxKB? +Section title (optional), Section content (required,question answer,no more than 4096 characters)), question (optional,one per line in the cell) +MaxKB product introduction,"MaxKB is a knowledge base question-answering system based on the LLM large language model. MaxKB = Max Knowledge Base,aims to become the most powerful brain of the enterprise。Out-of-the-box: supports direct document upload、automatic crawling of online documents、automatic text splitting and vectorization、and good intelligent question-answering interactive experience;Seamless embedding: supports zero-coding and rapid embedding into third-party business systems;Multi-model support: supports docking with mainstream large models,including Ollama local private large models (such as Llama 2、Llama 3、qwen)、Tongyi Qianwen、OpenAI、Azure OpenAI、Kimi、Zhipu AI、iFlytek Spark and Baidu Qianfan large models、etc.","What is MaxKB? MaxKB product introduction Large language model supported by MaxKB MaxKB advantages" \ No newline at end of file