From bac1a7c8706b240d0a7999410d5cfae7829c81a1 Mon Sep 17 00:00:00 2001 From: Sebastin Santy Date: Thu, 9 Apr 2020 04:15:18 +0530 Subject: [PATCH] Fix opennmt naming changes --- .gitignore | 5 ++++- Dockerfile | 5 ++--- mt/views.py | 2 +- mtsimple/views.py | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 32eacca..a9987ca 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,7 @@ model/ *.pyc db.sqlite3 pred.txt -conf.py \ No newline at end of file +conf.py +build +dist +*.egg-info \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 25271c8..eb3ebb4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,6 +4,5 @@ RUN mkdir /inmt WORKDIR /inmt COPY requirements.txt /inmt/ RUN pip install -r requirements.txt -RUN cd OpenNMT-py -RUN python setup.py install -COPY . /inmt/ \ No newline at end of file +COPY . /inmt/ +RUN python opennmt/setup.py install \ No newline at end of file diff --git a/mt/views.py b/mt/views.py index 30ca7d0..0b00897 100644 --- a/mt/views.py +++ b/mt/views.py @@ -16,7 +16,7 @@ import ast import sys import os dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -sys.path.insert(0, os.path.join(dir_path, 'OpenNMT-py')) +sys.path.insert(0, os.path.join(dir_path, 'opennmt')) from itertools import repeat diff --git a/mtsimple/views.py b/mtsimple/views.py index de06e7a..e48af42 100644 --- a/mtsimple/views.py +++ b/mtsimple/views.py @@ -11,7 +11,7 @@ import ast import sys import os dir_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) -sys.path.insert(0, os.path.join(dir_path, 'OpenNMT-py')) +sys.path.insert(0, os.path.join(dir_path, 'opennmt')) from onmt.utils.logging import init_logger from onmt.utils.misc import split_corpus