|
3 | 3 | [](https://github.com/microbit-foundation/pxt-microbit-ml-runner/actions/workflows/makecode.yml) |
4 | 4 | [](https://github.com/microbit-foundation/pxt-microbit-ml-runner/actions/workflows/header-gen.yml) |
5 | 5 |
|
6 | | -This project includes [ML4F](https://github.com/microsoft/ml4f) and a wrapper |
7 | | -to invoke a known type of model. It is left slim to be able to be import it |
8 | | -in other MakeCode extensions and a MicroPython module. |
| 6 | +This project wraps [ML4F](https://github.com/microsoft/ml4f) to invoke a known |
| 7 | +type of model that requires some data pre-processing. |
| 8 | +The wrapper is provided as a slim library to be able to be import it |
| 9 | +into other MakeCode extensions and as a MicroPython module. |
9 | 10 |
|
10 | 11 |
|
11 | | -## How to use your ML4F model with this extension |
| 12 | +## How to use external ML4F model with this extension |
12 | 13 |
|
13 | 14 | The ML4F wrapper library can be found in the `mlrunner` folder. |
14 | 15 | This repository also includes a pre-compiled model (inclusion can be controlled |
@@ -51,33 +52,34 @@ cd pxt-microbit-ml-runner |
51 | 52 | npm install pxt --no-save |
52 | 53 | npx pxt target microbit --no-save |
53 | 54 | npx pxt install |
54 | | -PXT_FORCE_LOCAL=1 PXT_NODOCKER=1 npx pxt |
| 55 | +PXT_FORCE_LOCAL=1 npx pxt |
55 | 56 | ``` |
56 | 57 |
|
57 | 58 | For the V1 build Yotta can hit the GitHub rate limits quite easily if the |
58 | 59 | project is built from a clean state more than once. |
59 | | -A V2-only build can be performed with the `PXT_COMPILE_SWITCHES=csv---mbcodal` |
| 60 | +A V2-only build can be triggered with the `PXT_COMPILE_SWITCHES=csv---mbcodal` |
60 | 61 | environmental variable. |
61 | 62 |
|
62 | 63 | ``` |
63 | 64 | PXT_FORCE_LOCAL=1 PXT_NODOCKER=1 PXT_COMPILE_SWITCHES=csv---mbcodal npx pxt |
64 | 65 | ``` |
65 | 66 |
|
66 | 67 | > [!CAUTION] |
67 | | -> **When updating to this repository, do NOT push changes to the `enums.d.ts` |
| 68 | +> **When updating this repository, do NOT push changes to the `enums.d.ts` |
68 | 69 | > or `shims.d.ts` files.** |
69 | 70 | > |
70 | 71 | > These are autogenerated by MakeCode to contain the enums and function shims |
71 | | -> from the C++ code to be accessible by TypeScript. However, these are only |
72 | | -> needed for the test code, and should **not** be shipped. |
| 72 | +> from the C++ code to be accessible via TypeScript. However, these are only |
| 73 | +> needed for the test code, and should **not** be shipped as it will affect |
| 74 | +> its usage as a MakeCode extension. |
73 | 75 | > |
74 | | -> So, it's recommended to use: `git update-index --skip-worktree <file>` |
| 76 | +> It's recommended to run locally: `git update-index --skip-worktree <file>` |
75 | 77 | > |
76 | 78 | > Unfortunately, adding `enums.d.ts` and `shims.d.ts` to the `testFiles` entry |
77 | 79 | > in `pxt.json` does not work, and they need to be added to `files` (so they |
78 | | -> are included with the extension files, not just the test files), and so they |
79 | | -> should be kept empty. Building the project locally includes the test files |
80 | | -> and will add code in there that should never be pushed. |
| 80 | +> end up included with the extension) and so, they should be kept empty. |
| 81 | +> Building the project locally compiles all the test files, will add code |
| 82 | +> to these `.d.ts` files, which should not be pushed. |
81 | 83 |
|
82 | 84 |
|
83 | 85 | ## Build flags |
|
0 commit comments