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
chenpangpang
transformers
Commits
f42816e7
Commit
f42816e7
authored
Nov 29, 2019
by
w4nderlust
Committed by
Julien Chaumond
Dec 03, 2019
Browse files
Added additional check for url and path in discriminator model params
parent
f10b9250
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
examples/run_pplm.py
examples/run_pplm.py
+4
-1
No files found.
examples/run_pplm.py
View file @
f42816e7
...
...
@@ -317,8 +317,11 @@ def get_classifier(
).
to
(
device
)
if
"url"
in
params
:
resolved_archive_file
=
cached_path
(
params
[
"url"
])
els
e
:
el
if
"path"
in
param
s
:
resolved_archive_file
=
params
[
"path"
]
else
:
raise
ValueError
(
"Either url or path have to be specified "
"in the discriminator model parameters"
)
classifier
.
load_state_dict
(
torch
.
load
(
resolved_archive_file
,
map_location
=
device
))
classifier
.
eval
()
...
...
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