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
a04c4cf4
"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "ad40e265156e18964245ed943943fdeb7d8cf61a"
Commit
a04c4cf4
authored
May 08, 2018
by
Myle Ott
Browse files
Fix --remove-bpe to strip trailing BPE symbols
parent
c53b2ee0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
fairseq/dictionary.py
fairseq/dictionary.py
+1
-1
No files found.
fairseq/dictionary.py
View file @
a04c4cf4
...
@@ -59,7 +59,7 @@ class Dictionary(object):
...
@@ -59,7 +59,7 @@ class Dictionary(object):
sent
=
' '
.
join
(
token_string
(
i
)
for
i
in
tensor
if
i
!=
self
.
eos
())
sent
=
' '
.
join
(
token_string
(
i
)
for
i
in
tensor
if
i
!=
self
.
eos
())
if
bpe_symbol
is
not
None
:
if
bpe_symbol
is
not
None
:
sent
=
sent
.
replace
(
bpe_symbol
,
''
)
sent
=
(
sent
+
' '
)
.
replace
(
bpe_symbol
,
''
)
.
rstrip
()
return
sent
return
sent
def
unk_string
(
self
,
escape
=
False
):
def
unk_string
(
self
,
escape
=
False
):
...
...
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