Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +4 -17
Dockerfile
CHANGED
|
@@ -42,10 +42,12 @@ RUN mkdir build && cd build && cmake .. && make -j4
|
|
| 42 |
# Python packages
|
| 43 |
RUN pip3 install pandas sacrebleu gradio scikit-learn
|
| 44 |
|
| 45 |
-
# Copy app + corpus
|
| 46 |
WORKDIR /workspace
|
| 47 |
COPY english_zomi_corpus.csv /workspace/
|
| 48 |
COPY app.py /workspace/
|
|
|
|
|
|
|
| 49 |
|
| 50 |
# --- Split corpus into train/test ---
|
| 51 |
RUN python3 -c "\
|
|
@@ -58,20 +60,5 @@ train_df['english'].to_csv('corpus.en', index=False, header=False); \
|
|
| 58 |
test_df['zomi'].to_csv('test.zomi.txt', index=False, header=False); \
|
| 59 |
test_df['english'].to_csv('test.en.txt', index=False, header=False)"
|
| 60 |
|
| 61 |
-
#
|
| 62 |
-
RUN /workspace/mosesdecoder/scripts/training/train-model.perl \
|
| 63 |
-
-root-dir /workspace/model \
|
| 64 |
-
-corpus /workspace/corpus \
|
| 65 |
-
-f zomi -e en \
|
| 66 |
-
-alignment grow-diag-final-and \
|
| 67 |
-
-reordering msd-bidirectional-fe \
|
| 68 |
-
-lm 0:3:/workspace/kenlm/build/bin/lmplz -external-bin-dir /workspace/tools
|
| 69 |
-
|
| 70 |
-
# --- Decode test set ---
|
| 71 |
-
RUN /workspace/mosesdecoder/bin/moses -f /workspace/model/model/moses.ini < /workspace/test.zomi.txt > /workspace/test.output.en
|
| 72 |
-
|
| 73 |
-
# --- Compute BLEU ---
|
| 74 |
-
RUN sacrebleu /workspace/test.en.txt -i /workspace/test.output.en -m bleu -b -w 2 > /workspace/BLEU.score.txt
|
| 75 |
-
|
| 76 |
-
# Default command: run Gradio app
|
| 77 |
CMD ["python3", "app.py"]
|
|
|
|
| 42 |
# Python packages
|
| 43 |
RUN pip3 install pandas sacrebleu gradio scikit-learn
|
| 44 |
|
| 45 |
+
# Copy app + corpus + training script
|
| 46 |
WORKDIR /workspace
|
| 47 |
COPY english_zomi_corpus.csv /workspace/
|
| 48 |
COPY app.py /workspace/
|
| 49 |
+
COPY run_training.sh /workspace/run_training.sh
|
| 50 |
+
RUN chmod +x /workspace/run_training.sh
|
| 51 |
|
| 52 |
# --- Split corpus into train/test ---
|
| 53 |
RUN python3 -c "\
|
|
|
|
| 60 |
test_df['zomi'].to_csv('test.zomi.txt', index=False, header=False); \
|
| 61 |
test_df['english'].to_csv('test.en.txt', index=False, header=False)"
|
| 62 |
|
| 63 |
+
# Default command: run Gradio app (training can be triggered via run_training.sh)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
CMD ["python3", "app.py"]
|