This repository has been archived by the owner on Sep 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[v1.8 bug-bash] fix webui error #2808
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -112,14 +112,14 @@ class Trial implements TableObj { | |
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
const duration = (endTime - this.info.startTime!) / 1000; | ||
let accuracy; | ||
if(this.acc !== undefined && this.acc.default !== undefined){ | ||
if(typeof this.acc.default === 'number'){ | ||
if (this.acc !== undefined && this.acc.default !== undefined) { | ||
if (typeof this.acc.default === 'number') { | ||
accuracy = JSON5.parse(this.acc.default); | ||
}else { | ||
} else { | ||
accuracy = this.acc.default; | ||
} | ||
} | ||
|
||
return { | ||
key: this.info.id, | ||
sequenceId: this.info.sequenceId, | ||
|
@@ -227,7 +227,7 @@ class Trial implements TableObj { | |
Object.entries(acc).forEach(item => { | ||
const [k, v] = item; | ||
const column = space.axes.get(k); | ||
|
||
if (column !== undefined) { | ||
ret.set(column, v); | ||
} else { | ||
|
@@ -245,7 +245,7 @@ class Trial implements TableObj { | |
} | ||
|
||
public finalKeys(): string[] { | ||
if(this.acc !== undefined){ | ||
if (this.acc !== undefined) { | ||
return Object.keys(this.acc); | ||
} else { | ||
return []; | ||
|
@@ -304,11 +304,16 @@ class Trial implements TableObj { | |
} | ||
|
||
private renderNumber(val: any): string { | ||
if(typeof val === 'number'){ | ||
if (typeof val === 'number') { | ||
if (isNaNorInfinity(val)) { | ||
return `${val}`; // show 'NaN' or 'Infinity' | ||
} else { | ||
return `${formatAccuracy(val)} (FINAL)`; | ||
if (this.accuracy === undefined) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes. |
||
return `${formatAccuracy(val)} (LATEST)`; | ||
} else { | ||
return `${formatAccuracy(val)} (FINAL)`; | ||
|
||
} | ||
} | ||
} else { | ||
// show other types, such as {tensor: {data: }} | ||
|
@@ -317,8 +322,8 @@ class Trial implements TableObj { | |
} | ||
|
||
public formatLatestAccuracy(): string { // TODO: this should be private | ||
if(this.status === 'SUCCEEDED'){ | ||
return (this.accuracy === undefined ? '--': this.renderNumber(this.accuracy)); | ||
if (this.status === 'SUCCEEDED') { | ||
return (this.accuracy === undefined ? '--' : this.renderNumber(this.accuracy)); | ||
} else { | ||
if (this.accuracy !== undefined) { | ||
return this.renderNumber(this.accuracy); | ||
|
@@ -330,7 +335,7 @@ class Trial implements TableObj { | |
return this.renderNumber(metricAccuracy(latest)); | ||
} | ||
} | ||
|
||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why the log of pai mode use 2 different components? can they use the same
PaiTrialLog
component?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logPathChild
just confirm that log string is hyperlink. Butlog
nested components will refactor next release.