"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "1073a2bde5d608f9891d6da6df7b63921dca1b71"
Commit f42816e7 authored by w4nderlust's avatar w4nderlust Committed by Julien Chaumond
Browse files

Added additional check for url and path in discriminator model params

parent f10b9250
...@@ -317,8 +317,11 @@ def get_classifier( ...@@ -317,8 +317,11 @@ def get_classifier(
).to(device) ).to(device)
if "url" in params: if "url" in params:
resolved_archive_file = cached_path(params["url"]) resolved_archive_file = cached_path(params["url"])
else: elif "path" in params:
resolved_archive_file = params["path"] 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( classifier.load_state_dict(
torch.load(resolved_archive_file, map_location=device)) torch.load(resolved_archive_file, map_location=device))
classifier.eval() classifier.eval()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment