File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,20 @@ This simple js web demo uses Dart Web Assembly support
7
7
## building/running
8
8
- Serve the output, example
9
9
10
- $ cd site
11
10
$ dart pub global activate dhttpd
12
11
$ dart pub global run dhttpd
13
12
14
- - Open your brwoser at : http://localhost:8080/site/index.html
13
+ - Open your browser at : http://localhost:8080/site/index.html
15
14
16
15
- type flower dimensions and run either using :
17
16
- a preloaded model (faster)
18
- - training a (small) model on on the fly
17
+ - training a (small) model on the fly
19
18
20
19
![ screenshot] ( screenshot.png )
21
20
22
21
23
22
- Compile with Wasm to a new site output directory:
24
23
25
- mywebapp $ dart compile wasm web/main.dart -o site/test.wasm
24
+ $ dart compile wasm web/main.dart -o site/test.wasm
26
25
27
26
For more details see documentation from https://dart.dev/web/wasm
Original file line number Diff line number Diff line change 2
2
< html >
3
3
< head >
4
4
< title > Test ml dart wasm</ title >
5
- < link rel ="preload " href ="/test.wasm " as ="fetch " crossorigin >
5
+ < link rel ="preload " href ="/site/ test.wasm " as ="fetch " crossorigin >
6
6
</ head >
7
7
< body >
8
8
< h1 > What iris is this ?</ h1 >
19
19
< div id ="decisionTreeFull "> decisionTreeFull: Not run yet.</ div >
20
20
</ h2 >
21
21
< script type ="module ">
22
- const dartModulePromise = WebAssembly . compileStreaming ( fetch ( '/test.wasm' ) ) ;
22
+ const dartModulePromise = WebAssembly . compileStreaming ( fetch ( '/site/ test.wasm' ) ) ;
23
23
const imports = { } ;
24
- let dart2wasm_runtime = await import ( '/test.mjs' ) ;
24
+ let dart2wasm_runtime = await import ( '/site/ test.mjs' ) ;
25
25
let moduleInstance =
26
26
await dart2wasm_runtime . instantiate ( dartModulePromise , imports ) ;
27
27
dart2wasm_runtime . invoke ( moduleInstance ) ;
60
60
</ div >
61
61
</ body >
62
62
63
- </ html >
63
+ </ html >
You can’t perform that action at this time.
0 commit comments