Skip to content

Commit db05243

Browse files
authored
Merge pull request #89 from semi-technologies/WEAVIATE-311-sum-transformers
Add support for sum-transformers module
2 parents c373e95 + 9b69034 commit db05243

7 files changed

+145
-4
lines changed

.cicd/test.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function check_creates_template() {
102102
check_modules "--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.enabled=true --set modules.img2vec-neural.enabled=false --set modules.qna-transformers.enabled=true --set modules.text-spellcheck.enabled=true --set modules.ner-transformers.enabled=true --set modules.multi2vec-clip.enabled=true --set modules.text2vec-openai.enabled=true" "value: text2vec-transformers,qna-transformers,ner-transformers,text-spellcheck,multi2vec-clip,text2vec-openai"
103103
check_modules "--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.enabled=false --set modules.img2vec-neural.enabled=false --set modules.qna-transformers.enabled=false --set modules.text-spellcheck.enabled=false --set modules.ner-transformers.enabled=false --set modules.multi2vec-clip.enabled=false --set modules.text2vec-openai.enabled=true" "value: text2vec-openai"
104104
check_modules "--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.enabled=false --set modules.img2vec-neural.enabled=false --set modules.qna-transformers.enabled=false --set modules.text-spellcheck.enabled=false --set modules.ner-transformers.enabled=false --set modules.multi2vec-clip.enabled=false --set modules.text2vec-openai.enabled=true --set modules.text2vec-openai.apiKey=apiKey" "value: text2vec-openai"
105-
105+
check_modules "--set modules.text2vec-contextionary.enabled=true --set modules.sum-transformers.enabled=true" "value: text2vec-contextionary,sum-transformers"
106106

107107

108108
_settingPassageQueryOn="--set modules.text2vec-contextionary.enabled=false --set modules.text2vec-transformers.passageQueryServices.passage.enabled=true --set modules.text2vec-transformers.passageQueryServices.query.enabled=true"

weaviate/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ type: application
77
# This is the chart version. This version number should be incremented each time you make changes
88
# to the chart and its templates, including the app version.
99
# Versions are expected to follow Semantic Versioning (https://semver.org/)
10-
version: 14.3.0
10+
version: 15.0.0
1111

1212
# This is the version number of the application being deployed. This version number should be
1313
# incremented each time you make changes to the application. Versions are not expected to
1414
# follow Semantic Versioning. They should reflect the version the application is using.
15-
appVersion: 1.14.0
15+
appVersion: 1.15.0
1616
icon: https://raw.githubusercontent.com/semi-technologies/weaviate/19de0956c69b66c5552447e84d016f4fe29d12c9/docs/assets/weaviate-logo.png

weaviate/templates/_helpers.tpl

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@
2020
{{- if or (index .Values "modules" "ner-transformers" "enabled") (index .Values "modules" "ner-transformers" "inferenceUrl") -}}
2121
{{ $modules = append $modules "ner-transformers" }}
2222
{{- end -}}
23+
{{- if or (index .Values "modules" "sum-transformers" "enabled") (index .Values "modules" "sum-transformers" "inferenceUrl") -}}
24+
{{ $modules = append $modules "sum-transformers" }}
25+
{{- end -}}
2326
{{- if or (index .Values "modules" "text-spellcheck" "enabled") (index .Values "modules" "text-spellcheck" "inferenceUrl") -}}
2427
{{ $modules = append $modules "text-spellcheck" }}
2528
{{- end -}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
{{ if index .Values "modules" "sum-transformers" "enabled" }}
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
6+
labels:
7+
name: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
8+
app: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
9+
spec:
10+
replicas: {{ index .Values "modules" "sum-transformers" "replicas" }}
11+
selector:
12+
matchLabels:
13+
app: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
14+
template:
15+
metadata:
16+
labels:
17+
app: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
18+
spec:
19+
containers:
20+
- name: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
21+
image: {{ index .Values "modules" "sum-transformers" "registry" }}/{{ index .Values "modules" "sum-transformers" "repo" }}:{{ index .Values "modules" "sum-transformers" "tag" }}
22+
env:
23+
- name: ENABLE_CUDA
24+
value: "{{ if index .Values "modules" "sum-transformers" "envconfig" "enable_cuda" }}1{{ else }}0{{ end }}"
25+
{{ if index .Values "modules" "sum-transformers" "envconfig" "enable_cuda" }}
26+
- name: NVIDIA_VISIBLE_DEVICES
27+
value: {{ index .Values "modules" "sum-transformers" "envconfig" "nvidia_visible_devices"}}
28+
- name: LD_LIBRARY_PATH
29+
value: {{ index .Values "modules" "sum-transformers" "envconfig" "ld_library_path"}}
30+
{{ end }}
31+
resources:
32+
{{ index .Values "modules" "sum-transformers" "resources" | toYaml | indent 10 }}
33+
livenessProbe:
34+
httpGet:
35+
path: /.well-known/live
36+
port: 8080
37+
initialDelaySeconds: 120
38+
periodSeconds: 3
39+
timeoutSeconds: 3
40+
readinessProbe:
41+
httpGet:
42+
path: /.well-known/ready
43+
port: 8080
44+
initialDelaySeconds: 3
45+
periodSeconds: 3
46+
{{- with index .Values "modules" "sum-transformers" "nodeSelector" | default .Values.nodeSelector }}
47+
nodeSelector:
48+
{{ toYaml . | nindent 8 }}
49+
{{- end }}
50+
{{- with index .Values "modules" "sum-transformers" "affinity" | default .Values.affinity }}
51+
affinity:
52+
{{ toYaml . | nindent 8 }}
53+
{{- end }}
54+
{{- with index .Values "modules" "sum-transformers" "tolerations" | default .Values.tolerations }}
55+
tolerations:
56+
{{ toYaml . | nindent 8 }}
57+
{{- end }}
58+
{{ end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{ if index .Values "modules" "sum-transformers" "enabled" }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
6+
spec:
7+
type: ClusterIP
8+
selector:
9+
app: {{ index .Values "modules" "sum-transformers" "fullnameOverride" }}
10+
ports:
11+
- protocol: TCP
12+
port: 8080
13+
targetPort: 8080
14+
{{ end }}

weaviate/templates/weaviateStatefulset.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ spec:
126126
- name: NER_INFERENCE_API
127127
value: {{ index .Values "modules" "ner-transformers" "inferenceUrl" }}
128128
{{- end }}
129+
{{- if index .Values "modules" "sum-transformers" "enabled" }}
130+
- name: SUM_INFERENCE_API
131+
value: http://{{ index .Values "modules" "sum-transformers" "fullnameOverride" }}.{{ .Release.Namespace }}.svc.cluster.local:8080
132+
{{- else if index .Values "modules" "sum-transformers" "inferenceUrl" }}
133+
- name: SUM_INFERENCE_API
134+
value: {{ index .Values "modules" "sum-transformers" "inferenceUrl" }}
135+
{{- end }}
129136
{{- if and (index .Values "modules" "text2vec-openai" "enabled") (index .Values "modules" "text2vec-openai" "apiKey") }}
130137
- name: OPENAI_APIKEY
131138
valueFrom:

weaviate/values.yaml

+60-1
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,9 @@ modules:
250250
# enable if you want to use transformers instead of the
251251
# text2vec-contextionary module
252252
enabled: false
253-
253+
# You can set directly an inference URL of this module without deploying it with this release.
254+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
255+
inferenceUrl: {}
254256
# The configuration below is ignored if enabled==false
255257

256258
# replace with model of choice, see
@@ -290,6 +292,9 @@ modules:
290292
passageQueryServices:
291293
passage:
292294
enabled: false
295+
# You can set directly an inference URL of this module without deploying it with this release.
296+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
297+
inferenceUrl: {}
293298

294299
tag: facebook-dpr-ctx_encoder-single-nq-base
295300
repo: semitechnologies/transformers-inference
@@ -322,6 +327,9 @@ modules:
322327
# nvidia.com/gpu: 1
323328
query:
324329
enabled: false
330+
# You can set directly an inference URL of this module without deploying it with this release.
331+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
332+
inferenceUrl: {}
325333

326334
tag: facebook-dpr-question_encoder-single-nq-base
327335
repo: semitechnologies/transformers-inference
@@ -389,6 +397,9 @@ modules:
389397
# enable if you want to use transformers instead of the
390398
# text2vec-contextionary module
391399
enabled: false
400+
# You can set directly an inference URL of this module without deploying it with this release.
401+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
402+
inferenceUrl: {}
392403

393404
# The configuration below is ignored if enabled==false
394405

@@ -429,6 +440,9 @@ modules:
429440
# DistilBERT, to find an aswer in text to a given question
430441
qna-transformers:
431442
enabled: false
443+
# You can set directly an inference URL of this module without deploying it with this release.
444+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
445+
inferenceUrl: {}
432446
tag: bert-large-uncased-whole-word-masking-finetuned-squad-34d66b1
433447
repo: semitechnologies/qna-transformers
434448
registry: docker.io
@@ -463,6 +477,9 @@ modules:
463477
# a vector representation of the image
464478
img2vec-neural:
465479
enabled: false
480+
# You can set directly an inference URL of this module without deploying it with this release.
481+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
482+
inferenceUrl: {}
466483
tag: resnet50
467484
repo: semitechnologies/img2vec-pytorch
468485
registry: docker.io
@@ -497,6 +514,9 @@ modules:
497514
# misspellings in a given text
498515
text-spellcheck:
499516
enabled: false
517+
# You can set directly an inference URL of this module without deploying it with this release.
518+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
519+
inferenceUrl: {}
500520
tag: pyspellchecker-en
501521
repo: semitechnologies/text-spellcheck-model
502522
registry: docker.io
@@ -531,6 +551,9 @@ modules:
531551
# misspellings in a given text
532552
ner-transformers:
533553
enabled: false
554+
# You can set directly an inference URL of this module without deploying it with this release.
555+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
556+
inferenceUrl: {}
534557
tag: dbmdz-bert-large-cased-finetuned-conll03-english-0.0.2
535558
repo: semitechnologies/ner-transformers
536559
registry: docker.io
@@ -561,6 +584,42 @@ modules:
561584
# enable if running with CUDA support
562585
# nvidia.com/gpu: 1
563586

587+
# The sum-transformers module makes result texts summarizations
588+
sum-transformers:
589+
enabled: false
590+
# You can set directly an inference URL of this module without deploying it with this release.
591+
# You can do so by setting a value for the `inferenceUrl` here AND by setting the `enable` to `false`
592+
inferenceUrl: {}
593+
tag: facebook-bart-large-cnn-1.0.0
594+
repo: semitechnologies/sum-transformers
595+
registry: docker.io
596+
replicas: 1
597+
fullnameOverride: sum-transformers
598+
envconfig:
599+
# enable for CUDA support. Your K8s cluster needs to be configured
600+
# accordingly and you need to explicitly set GPU requests & limits below
601+
enable_cuda: false
602+
603+
# only used when cuda is enabled
604+
nvidia_visible_devices: all
605+
606+
# only used when cuda is enabled
607+
ld_library_path: /usr/local/nvidia/lib64
608+
609+
resources:
610+
requests:
611+
cpu: '1000m'
612+
memory: '3000Mi'
613+
614+
# enable if running with CUDA support
615+
# nvidia.com/gpu: 1
616+
limits:
617+
cpu: '1000m'
618+
memory: '5000Mi'
619+
620+
# enable if running with CUDA support
621+
# nvidia.com/gpu: 1
622+
564623
# by choosing the default vectorizer module, you can tell Weaviate to always
565624
# use this module as the vectorizer if nothing else is specified. Can be
566625
# overwritten on a per-class basis.

0 commit comments

Comments
 (0)