forked from RasaHQ/rasa
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from epoch8/3.6.5-e8-full
3.6.5 e8 full
- Loading branch information
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# The image tagged with the 'spacy-it' suffix | ||
ARG IMAGE_BASE_NAME | ||
ARG BASE_IMAGE_HASH | ||
ARG BASE_BUILDER_IMAGE_HASH | ||
|
||
FROM ${IMAGE_BASE_NAME}:base-builder-${BASE_BUILDER_IMAGE_HASH} as builder | ||
|
||
# copy files | ||
COPY . /build/ | ||
COPY docker/configs/config_pretrained_embeddings_sbert_large.yml /build/config.yml | ||
|
||
# change working directory | ||
WORKDIR /build | ||
|
||
# install dependencies | ||
RUN python -m venv /opt/venv && \ | ||
. /opt/venv/bin/activate && pip install --no-cache-dir -U "pip==22.*" -U "wheel>0.38.0" | ||
RUN . /opt/venv/bin/activate && poetry install --extras transformers --no-dev --no-root --no-interaction | ||
RUN . /opt/venv/bin/activate && poetry build -f wheel -n && \ | ||
pip install --no-deps dist/*.whl && \ | ||
rm -rf dist *.egg-info | ||
|
||
# make sure we use the virtualenv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# start a new build stage | ||
FROM ${IMAGE_BASE_NAME}:base-${BASE_IMAGE_HASH} as runner | ||
|
||
# copy everything from /opt | ||
COPY --from=builder /opt/venv /opt/venv | ||
|
||
# make sure we use the virtualenv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# set HOME environment variable | ||
ENV HOME=/app | ||
|
||
# update permissions & change user to not run as root | ||
WORKDIR /app | ||
|
||
RUN pip install huggingface_hub | ||
RUN python -c "from huggingface_hub import snapshot_download; snapshot_download(repo_id='ai-forever/sbert_large_mt_nlu_ru', ignore_patterns=['*.msgpack', '*.bin'], local_dir='./weighs', local_dir_use_symlinks=True);" | ||
|
||
RUN chgrp -R 0 /app && chmod -R g=u /app && chmod o+wr /app | ||
USER 1001 | ||
|
||
# Create a volume for temporary data | ||
VOLUME /tmp | ||
|
||
# change shell | ||
SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
|
||
# the entry point | ||
EXPOSE 5005 | ||
ENTRYPOINT ["rasa"] | ||
CMD ["--help"] |
18 changes: 18 additions & 0 deletions
18
docker/configs/config_pretrained_embeddings_sbert_large.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
language: "ru" | ||
|
||
pipeline: | ||
- name: WhitespaceTokenizer | ||
- name: RegexFeaturizer | ||
|
||
- name: LanguageModelFeaturizer | ||
model_name: "bert" | ||
model_weights: "weighs" | ||
|
||
- name: DIETClassifier | ||
epochs: 50 | ||
batch_size: 4 | ||
constrain_similarities: true | ||
|
||
- name: FallbackClassifier | ||
threshold: 0.2 | ||
ambiguity_threshold: 0.05 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters