Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
Fairseq
Commits
16caed31
"git@developer.sourcefind.cn:OpenDAS/torchaudio.git" did not exist on "eab8aa746cd4357a3b9d04d18e43a2a51d0c73c2"
Commit
16caed31
authored
Jun 14, 2018
by
Myle Ott
Browse files
Change --path to be colon-separated instead of comma-separated
parent
ef179415
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
4 deletions
+4
-4
eval_lm.py
eval_lm.py
+1
-1
fairseq/options.py
fairseq/options.py
+1
-1
generate.py
generate.py
+1
-1
interactive.py
interactive.py
+1
-1
No files found.
eval_lm.py
View file @
16caed31
...
@@ -30,7 +30,7 @@ def main(args):
...
@@ -30,7 +30,7 @@ def main(args):
# Load ensemble
# Load ensemble
print
(
'| loading model(s) from {}'
.
format
(
args
.
path
))
print
(
'| loading model(s) from {}'
.
format
(
args
.
path
))
models
,
_
=
utils
.
load_ensemble_for_inference
(
args
.
path
.
split
(
'
,
'
),
task
)
models
,
_
=
utils
.
load_ensemble_for_inference
(
args
.
path
.
split
(
'
:
'
),
task
)
# Optimize ensemble for generation and set the source and dest dicts on the model (required by scorer)
# Optimize ensemble for generation and set the source and dest dicts on the model (required by scorer)
for
model
in
models
:
for
model
in
models
:
...
...
fairseq/options.py
View file @
16caed31
...
@@ -237,7 +237,7 @@ def add_checkpoint_args(parser):
...
@@ -237,7 +237,7 @@ def add_checkpoint_args(parser):
def
add_common_eval_args
(
group
):
def
add_common_eval_args
(
group
):
group
.
add_argument
(
'--path'
,
metavar
=
'FILE'
,
group
.
add_argument
(
'--path'
,
metavar
=
'FILE'
,
help
=
'path(s) to model file(s), co
mma
separated'
)
help
=
'path(s) to model file(s), co
lon
separated'
)
group
.
add_argument
(
'--remove-bpe'
,
nargs
=
'?'
,
const
=
'@@ '
,
default
=
None
,
group
.
add_argument
(
'--remove-bpe'
,
nargs
=
'?'
,
const
=
'@@ '
,
default
=
None
,
help
=
'remove BPE tokens before scoring'
)
help
=
'remove BPE tokens before scoring'
)
group
.
add_argument
(
'--cpu'
,
action
=
'store_true'
,
help
=
'generate on CPU'
)
group
.
add_argument
(
'--cpu'
,
action
=
'store_true'
,
help
=
'generate on CPU'
)
...
...
generate.py
View file @
16caed31
...
@@ -38,7 +38,7 @@ def main(args):
...
@@ -38,7 +38,7 @@ def main(args):
# Load ensemble
# Load ensemble
print
(
'| loading model(s) from {}'
.
format
(
args
.
path
))
print
(
'| loading model(s) from {}'
.
format
(
args
.
path
))
models
,
_
=
utils
.
load_ensemble_for_inference
(
[
args
.
path
]
,
task
)
models
,
_
=
utils
.
load_ensemble_for_inference
(
args
.
path
.
split
(
':'
)
,
task
)
# Optimize ensemble for generation
# Optimize ensemble for generation
for
model
in
models
:
for
model
in
models
:
...
...
interactive.py
View file @
16caed31
...
@@ -73,7 +73,7 @@ def main(args):
...
@@ -73,7 +73,7 @@ def main(args):
# Load ensemble
# Load ensemble
print
(
'| loading model(s) from {}'
.
format
(
args
.
path
))
print
(
'| loading model(s) from {}'
.
format
(
args
.
path
))
model_paths
=
args
.
path
.
split
(
'
,
'
)
model_paths
=
args
.
path
.
split
(
'
:
'
)
models
,
model_args
=
utils
.
load_ensemble_for_inference
(
model_paths
,
task
)
models
,
model_args
=
utils
.
load_ensemble_for_inference
(
model_paths
,
task
)
# Set dictionaries
# Set dictionaries
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment