Skip to content

Commit 17da64c

Browse files
Added *.swp to gitignore
1 parent 1b5c7c8 commit 17da64c

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ javah/
88

99
build/
1010

11+
# Bash vim
12+
*.swp
13+
1114
# CMake
1215
cmake-build-*
1316

src/decoder-opennmt/src/python/nmt_decoder.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
from onmt.opennmt import OpenNMTDecoder
77

88
import logging
9-
logging.basicConfig(level=logging.INFO)
9+
1010

1111
class TranslationRequest:
1212
def __init__(self, source, suggestions=None):
@@ -102,37 +102,37 @@ def run_main():
102102
parser.add_argument('-g', '-gpu', dest='gpu', metavar='GPU', help='the index of the GPU to use',
103103
default=-1)
104104

105-
parser.add_argument('-beam_size', type=int, default=5,
106-
help='Beam size')
105+
parser.add_argument('-beam_size', type=int, default=5,
106+
help='Beam size')
107107
parser.add_argument('-batch_size', type=int, default=30,
108-
help='Batch size')
108+
help='Batch size')
109109
parser.add_argument('-max_sent_length', type=int, default=100,
110-
help='Maximum sentence length.')
110+
help='Maximum sentence length.')
111111
parser.add_argument('-replace_unk', action="store_true",
112-
help="""Replace the generated UNK tokens with the source
112+
help="""Replace the generated UNK tokens with the source
113113
token that had the highest attention weight. If phrase_table
114114
is provided, it will lookup the identified source token and
115115
give the corresponding target token. If it is not provided
116116
(or the identified source token does not exist in the
117117
table) then it will copy the source token""")
118118
parser.add_argument('-verbose', action="store_true",
119-
help='Print scores and predictions for each sentence')
119+
help='Print scores and predictions for each sentence')
120120
parser.add_argument('-dump_beam', type=str, default="",
121-
help='File to dump beam information to.')
121+
help='File to dump beam information to.')
122122
parser.add_argument('-n_best', type=int, default=1,
123-
help="""If verbose is set, will output the n_best
123+
help="""If verbose is set, will output the n_best
124124
decoded sentences""")
125125
parser.add_argument('-tuning_epochs', type=int, default=5,
126-
help='Number of tuning epochs')
126+
help='Number of tuning epochs')
127127

128-
#seed for generating random numbers
129-
parser.add_argument('-seed', type=int, default=3435,
130-
help="Random seed for generating random numbers (-1 for un-defined the seed; default is 3435); ")
128+
# seed for generating random numbers
129+
parser.add_argument('-seed', type=int, default=3435,
130+
help="Random seed for generating random numbers (-1 for un-defined the seed; default is 3435); ")
131131

132132
parser.add_argument('-tunable', action="store_true",
133-
help='Enable fine tuning')
133+
help='Enable fine tuning')
134134
parser.add_argument('-reset', action="store_true",
135-
help='Reset model to the original model after each translation')
135+
help='Reset model to the original model after each translation')
136136

137137
args = parser.parse_args()
138138

Binary file not shown.

0 commit comments

Comments
 (0)