Unverified Commit cc5a4fc5 authored by liuzhe-lz's avatar liuzhe-lz Committed by GitHub
Browse files

fix bugs (#4036)


Co-authored-by: default avatarliuzhe <zhe.liu@microsoft.com>
parent a15eeab6
...@@ -600,7 +600,7 @@ def manage_external_experiment(args, mode): ...@@ -600,7 +600,7 @@ def manage_external_experiment(args, mode):
else: else:
print_normal('NNI can not detect experiment id in argument, will use last folder name as experiment id in experiment_dir argument.') print_normal('NNI can not detect experiment id in argument, will use last folder name as experiment id in experiment_dir argument.')
experiment_id = Path(args.experiment_dir).name experiment_id = Path(args.experiment_dir).name
log_dir = os.path.dirname(args.experiment_dir) log_dir = str(Path(args.experiment_dir).parent)
if not experiment_id: if not experiment_id:
print_error("Please set experiment id argument, or add id as the last folder name in experiment_dir argument.") print_error("Please set experiment id argument, or add id as the last folder name in experiment_dir argument.")
exit(1) exit(1)
......
...@@ -306,10 +306,10 @@ class NNIRestHandler { ...@@ -306,10 +306,10 @@ class NNIRestHandler {
encoding = 'utf8'; encoding = 'utf8';
} }
this.nniManager.getTrialFile(req.params.id, filename).then((content: Buffer | string) => { this.nniManager.getTrialFile(req.params.id, filename).then((content: Buffer | string) => {
if (content instanceof Buffer) { const contentType = content instanceof Buffer ? 'application/octet-stream' : 'text/plain';
res.header('Content-Type', 'application/octet-stream'); res.header('Content-Type', contentType);
} else if (content === '') { if (content === '') {
content = `${filename} is empty.`; content = `${filename} is empty.`; // FIXME: this should be handled in front-end
} }
res.send(content); res.send(content);
}).catch((err: Error) => { }).catch((err: Error) => {
......
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