浏览代码

fix nltk averaged_perceptron_tagger download and fix score limit is none (#7582)

Co-authored-by: crazywoola <100913391+crazywoola@users.noreply.github.com>
tags/0.7.2
Jyong 1年前
父节点
当前提交
7ae728a9a3
没有帐户链接到提交者的电子邮件
共有 3 个文件被更改,包括 3 次插入1 次删除
  1. 1
    0
      api/.idea/vcs.xml
  2. 1
    1
      api/Dockerfile
  3. 1
    0
      api/core/rag/retrieval/dataset_retrieval.py

+ 1
- 0
api/.idea/vcs.xml 查看文件

@@ -12,5 +12,6 @@
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

+ 1
- 1
api/Dockerfile 查看文件

@@ -65,7 +65,7 @@ COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"

# Download nltk data
RUN python -c "import nltk; nltk.download('punkt')"
RUN python -c "import nltk; nltk.download('punkt'); nltk.download('averaged_perceptron_tagger')"

# Copy source code
COPY . /app/api/

+ 1
- 0
api/core/rag/retrieval/dataset_retrieval.py 查看文件

@@ -616,6 +616,7 @@ class DatasetRetrieval:
for document in all_documents:
if score_threshold is None or document.metadata['score'] >= score_threshold:
filter_documents.append(document)

if not filter_documents:
return []
filter_documents = sorted(filter_documents, key=lambda x: x.metadata['score'], reverse=True)

正在加载...
取消
保存