Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
panickal-xmos committed Jun 19, 2023
1 parent 9dc1f0c commit f494980
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Perform the following steps once:

* ``pip3 install xmos-ai-tools --upgrade``; use a virtual-environment of your choice.

Use ``pip install xmos-ai-tools --pre --upgrade`` instead if you want to install the latest development version.
Use ``pip3 install xmos-ai-tools --pre --upgrade`` instead if you want to install the latest development version.

```python
from xmos_ai_tools import xformer as xf
Expand Down Expand Up @@ -66,8 +66,8 @@ xf.convert("example_int8_model.tflite", "xcore_optimised_int8_flash_model.tflite
from xmos_ai_tools.xinterpreters import xcore_tflm_host_interpreter

ie = xcore_tflm_host_interpreter()
ie.set_model(model_path=xcore_model, params_path=xcore_params)
ie.set_tensor(ie.get_input_details()[0]['index'], value=input)
ie.set_model(model_path='path_to_xcore_model', params_path='path_to_xcore_params')
ie.set_tensor(ie.get_input_details()[0]['index'], value='input_data')
ie.invoke()

xformer_outputs = []
Expand Down
4 changes: 2 additions & 2 deletions docs/rst/flow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Perform the following steps once:

* ``pip3 install xmos-ai-tools --upgrade``; use a virtual-environment of your choice.

Use ``pip install xmos-ai-tools --pre --upgrade`` instead if you want to install the latest development version.
Use ``pip3 install xmos-ai-tools --pre --upgrade`` instead if you want to install the latest development version.

Installing ``xmos-ai-tools`` will make the xcore-opt binary available in your shell to use directly, or you can use the Python interface as detailed `here <https://github.com/xmos/ai_tools/blob/02cdcf6/docs/rst/python.rst>`_.
Installing ``xmos-ai-tools`` will make the xcore-opt binary available in your shell to use directly, or you can use the Python interface as detailed `here <https://github.com/xmos/ai_tools/blob/develop/docs/rst/python.rst>`_.

* Obtain the tool-chain from http://www.xmos.ai/tools and install it
according to the platform instructions.
Expand Down
14 changes: 7 additions & 7 deletions docs/rst/python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ of options and their value.

.. code-block:: Python
xf.convert("example_int8_model.tflite", "xcore_optimized_int8_model.tflite",
{"mlir-disable-threading": None, "xcore-reduce-memory": None,}
)
xf.convert("example_int8_model.tflite", "xcore_optimised_int8_model.tflite", {
"xcore-thread-count": "5",
})
The possible options are described below in the command line interface section. If the default operation is intended this third argument can be "None".

Expand All @@ -40,7 +40,7 @@ To create a parameters file and a tflite model suitable for loading to flash, us
.. code-block:: Python
xf.convert("example_int8_model.tflite", "xcore_optimised_int8_flash_model.tflite", {
"xcore-flash-image-file ": "./xcore_params.params",
"xcore-flash-image-file": "./xcore_params.params",
})
The python interface also contains a host-side interpreter for tflite
Expand All @@ -57,10 +57,10 @@ run inference on a model the interpreters can be used as such:
.. code-block:: Python
ie = xcore_tflm_host_interpreter()
ie.set_model(model_path = xcore_model)
ie.set_input_tensor(data = input)
ie.set_model(model_path='path_to_xcore_model', params_path='path_to_xcore_params')
ie.set_tensor(ie.get_input_details()[0]['index'], value='input_data')
ie.invoke()
xformer_outputs = []
for i in range(num_of_outputs):
xformer_outputs.append(ie.get_output_tensor(output_index = i))
xformer_outputs.append(ie.get_tensor(ie.get_output_details()[i]['index']))

0 comments on commit f494980

Please sign in to comment.