File tree Expand file tree Collapse file tree 2 files changed +4
-11
lines changed
src/Libraries/Microsoft.Extensions.AI.Evaluation.Reporting/TypeScript Expand file tree Collapse file tree 2 files changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,9 @@ function App() {
55
55
const toggleSettings = ( ) => setIsSettingsOpen ( ! isSettingsOpen ) ;
56
56
const closeSettings = ( ) => setIsSettingsOpen ( false ) ;
57
57
58
- const downloadDataset = ( ) => {
59
- // check if dataset has a default property that duplicates the content
60
- const containsDefault = 'default' in dataset &&
61
- typeof dataset . default === 'object' &&
62
- dataset . default !== null &&
63
- 'scenarioRunResults' in ( dataset . default as any ) ;
64
-
65
- const dataToSerialize = containsDefault ? dataset . default : dataset ;
66
-
58
+ const downloadDataset = ( ) => {
67
59
// create a stringified JSON of the dataset
68
- const dataStr = JSON . stringify ( dataToSerialize , null , 2 ) ;
60
+ const dataStr = JSON . stringify ( dataset , null , 2 ) ;
69
61
70
62
// create a link to download the JSON file in the page and click it
71
63
const blob = new Blob ( [ dataStr ] , { type : 'application/json' } ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,8 @@ let dataset: Dataset = { scenarioRunResults: [] };
13
13
if ( ! import . meta. env . PROD ) {
14
14
// This only runs in development. In production the data is embedded into the dataset variable declaration above.
15
15
// run `node init-devdata.js` to populate the data file from the most recent execution.
16
- dataset = await import ( "../devdata.json" ) as unknown as Dataset ;
16
+ const imported = await import ( "../devdata.json" ) ;
17
+ dataset = imported . default as unknown as Dataset ;
17
18
}
18
19
19
20
const scoreSummary = createScoreSummary ( dataset ) ;
You can’t perform that action at this time.
0 commit comments