Skip to content

Commit

Permalink
ensure housekeeping on the training result folder
Browse files Browse the repository at this point in the history
  • Loading branch information
baixiac committed Nov 4, 2024
1 parent b5e1f40 commit e876992
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 25 deletions.
2 changes: 2 additions & 0 deletions app/trainers/medcat_deid_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def run(trainer: "MedcatDeIdentificationSupervisedTrainer",
examples = None
ner.training_arguments.num_train_epochs = 1
ner.training_arguments.logging_steps = 1
ner.training_arguments.overwrite_output_dir = False
ner.training_arguments.save_strategy = "no"
if training_params.get("lr_override") is not None:
ner.training_arguments.learning_rate = training_params["lr_override"]
if training_params.get("test_size") is not None:
Expand Down
9 changes: 4 additions & 5 deletions docker/medcat-deid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ RUN addgroup --gid $CMS_GID cms || true && \
adduser --uid $CMS_UID --gid $CMS_GID --disabled-password --gecos "" cms || true && \
echo "cms ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

WORKDIR /app

COPY --chown=$CMS_UID:$CMS_GID app /app
COPY --chown=$CMS_UID:$CMS_GID docker/medcat-deid/requirements.txt .
COPY app /app
COPY docker/medcat-deid/requirements.txt /app/requirements.txt
RUN mkdir -p /app/model/model && \
mkdir -p /app/model/retrained && \
chown -R $CMS_UID:$CMS_GID /app/model
chown -R $CMS_UID:$CMS_GID /app
RUN pip install --no-cache-dir -U pip &&\
pip install --no-cache-dir -r requirements.txt && \
python -m spacy download en_core_web_md

WORKDIR /app
EXPOSE 8000
USER cms:cms
CMD ["sh", "-c", "python cli/cli.py serve --model-type medcat_deid --model-name \"${CMS_MODEL_NAME}\" --model-path /app/model/model.zip --host 0.0.0.0 --port 8000"]
9 changes: 4 additions & 5 deletions docker/medcat-icd10/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ RUN addgroup --gid $CMS_GID cms || true && \
adduser --uid $CMS_UID --gid $CMS_GID --disabled-password --gecos "" cms || true && \
echo "cms ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

WORKDIR /app

COPY --chown=$CMS_UID:$CMS_GID app /app
COPY --chown=$CMS_UID:$CMS_GID docker/medcat-icd10/requirements.txt .
COPY app /app
COPY docker/medcat-icd10/requirements.txt /app/requirements.txt
RUN mkdir -p /app/model/model && \
mkdir -p /app/model/retrained && \
chown -R $CMS_UID:$CMS_GID /app/model
chown -R $CMS_UID:$CMS_GID /app
RUN pip install --no-cache-dir -U pip &&\
pip install --no-cache-dir -r requirements.txt && \
python -m spacy download en_core_web_md

WORKDIR /app
EXPOSE 8000
USER cms:cms
CMD ["sh", "-c", "python cli/cli.py serve --model-type medcat_icd10 --model-name \"${CMS_MODEL_NAME}\" --model-path /app/model/model.zip --host 0.0.0.0 --port 8000"]
9 changes: 4 additions & 5 deletions docker/medcat-snomed/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,16 @@ RUN addgroup --gid $CMS_GID cms || true && \
adduser --uid $CMS_UID --gid $CMS_GID --disabled-password --gecos "" cms || true && \
echo "cms ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

WORKDIR /app

COPY --chown=$CMS_UID:$CMS_GID app /app
COPY --chown=$CMS_UID:$CMS_GID docker/medcat-snomed/requirements.txt .
COPY app /app
COPY docker/medcat-snomed/requirements.txt /app/requirements.txt
RUN mkdir -p /app/model/model && \
mkdir -p /app/model/retrained && \
chown -R $CMS_UID:$CMS_GID /app/model
chown -R $CMS_UID:$CMS_GID /app
RUN pip install --no-cache-dir -U pip &&\
pip install --no-cache-dir -r requirements.txt && \
python -m spacy download en_core_web_md

WORKDIR /app
EXPOSE 8000
USER cms:cms
CMD ["sh", "-c", "python cli/cli.py serve --model-type medcat_snomed --model-name \"${CMS_MODEL_NAME}\" --model-path /app/model/model.zip --host 0.0.0.0 --port 8000"]
9 changes: 4 additions & 5 deletions docker/medcat-umls/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ RUN addgroup --gid $CMS_GID cms || true && \
adduser --uid $CMS_UID --gid $CMS_GID --disabled-password --gecos "" cms || true && \
echo "cms ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

WORKDIR /app

COPY --chown=$CMS_UID:$CMS_GID app /app
COPY --chown=$CMS_UID:$CMS_GID docker/medcat-umls/requirements.txt .
COPY app /app
COPY docker/medcat-umls/requirements.txt /app/requirements.txt
RUN mkdir -p /app/model/model && \
mkdir -p /app/model/retrained && \
chown -R $CMS_UID:$CMS_GID /app/model
chown -R $CMS_UID:$CMS_GID /app
RUN pip install --no-cache-dir -U pip &&\
pip install --no-cache-dir -r requirements.txt && \
python -m spacy download en_core_web_md

WORKDIR /app
EXPOSE 8000
USER cms:cms
CMD ["sh", "-c", "python cli/cli.py serve --model-type medcat_umls --model-name \"${CMS_MODEL_NAME}\" --model-path /app/model/model.zip --host 0.0.0.0 --port 8000"]
9 changes: 4 additions & 5 deletions docker/trf-deid/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,16 @@ RUN addgroup --gid $CMS_GID cms || true && \
adduser --uid $CMS_UID --gid $CMS_GID --disabled-password --gecos "" cms || true && \
echo "cms ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers

WORKDIR /app

COPY --chown=$CMS_UID:$CMS_GID app /app
COPY --chown=$CMS_UID:$CMS_GID docker/trf-deid/requirements.txt .
COPY app /app
COPY docker/trf-deid/requirements.txt /app/requirements.txt
RUN mkdir -p /app/model/model && \
mkdir -p /app/model/retrained && \
chown -R $CMS_UID:$CMS_GID /app/model
chown -R $CMS_UID:$CMS_GID /app
RUN pip install --no-cache-dir -U pip &&\
pip install --no-cache-dir -r requirements.txt && \
python -m spacy download en_core_web_md

WORKDIR /app
EXPOSE 8000
USER cms:cms
CMD ["sh", "-c", "python cli/cli.py serve --model-type transformers_deid --model-name \"${CMS_MODEL_NAME}\" --model-path /app/model/model.zip --host 0.0.0.0 --port 8000"]

0 comments on commit e876992

Please sign in to comment.