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() {
5555 const toggleSettings = ( ) => setIsSettingsOpen ( ! isSettingsOpen ) ;
5656 const closeSettings = ( ) => setIsSettingsOpen ( false ) ;
5757
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 = ( ) => {
6759 // create a stringified JSON of the dataset
68- const dataStr = JSON . stringify ( dataToSerialize , null , 2 ) ;
60+ const dataStr = JSON . stringify ( dataset , null , 2 ) ;
6961
7062 // create a link to download the JSON file in the page and click it
7163 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: [] };
1313if ( ! import . meta. env . PROD ) {
1414 // This only runs in development. In production the data is embedded into the dataset variable declaration above.
1515 // 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 ;
1718}
1819
1920const scoreSummary = createScoreSummary ( dataset ) ;
You can’t perform that action at this time.
0 commit comments