Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Fix 2 bugs found in bug bash #4036

Merged
merged 1 commit into from
Aug 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nni/tools/nnictl/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ def manage_external_experiment(args, mode):
else:
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
log_dir = os.path.dirname(args.experiment_dir)
log_dir = str(Path(args.experiment_dir).parent)
if not experiment_id:
print_error("Please set experiment id argument, or add id as the last folder name in experiment_dir argument.")
exit(1)
Expand Down
8 changes: 4 additions & 4 deletions ts/nni_manager/rest_server/restHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ class NNIRestHandler {
encoding = 'utf8';
}
this.nniManager.getTrialFile(req.params.id, filename).then((content: Buffer | string) => {
if (content instanceof Buffer) {
res.header('Content-Type', 'application/octet-stream');
} else if (content === '') {
content = `${filename} is empty.`;
const contentType = content instanceof Buffer ? 'application/octet-stream' : 'text/plain';
res.header('Content-Type', contentType);
if (content === '') {
content = `${filename} is empty.`; // FIXME: this should be handled in front-end
}
res.send(content);
}).catch((err: Error) => {
Expand Down