add nltk punkt resource (#7063)

pull/7095/head^2
Jyong 2 years ago committed by GitHub
parent 34a9dbe826
commit 169cde6c3c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -55,6 +55,9 @@ ENV VIRTUAL_ENV=/app/api/.venv
COPY --from=packages ${VIRTUAL_ENV} ${VIRTUAL_ENV}
ENV PATH="${VIRTUAL_ENV}/bin:${PATH}"
# Download nltk data
RUN python -c "import nltk; nltk.download('punkt')"
# Copy source code
COPY . /app/api/

@ -159,10 +159,9 @@ class WeightRerankRunner:
if 'score' in document.metadata:
query_vector_scores.append(document.metadata['score'])
else:
content_vector = document.metadata['vector']
# transform to NumPy
vec1 = np.array(query_vector)
vec2 = np.array(document.metadata['vector'])
vec2 = np.array(document.vector)
# calculate dot product
dot_product = np.dot(vec1, vec2)

Loading…
Cancel
Save