Skip to content

Latest commit

 

History

History
59 lines (39 loc) · 2.08 KB

demos.md

File metadata and controls

59 lines (39 loc) · 2.08 KB

Curiosity Toolkit Demos

This document describes how to setup and initialise our demos applications included in our curiosity toolkit:

First of all, it is necessary to setup the required environment. To do so, please read instructions reported in the technical documentation here.

Setup the Learning Machine

The learning machine is composed by a frontend component, and a backend component. The two components have to be executed both in order to make the demo working.

(a) To run the backend it is just necessary to execute the app.py file, located in the main folder of the backend component, i.e. learning_machine/backend:

python app.py

This will run the backend webserver on the localhost address (i.e. 127.0.0.1), and port 8000.

Alternatively, it is also possible to run the webserver directly running the uvicorn server, with the following command:

uvicorn app:learning_machine_backend --reload

(b) The frontend is a simple HTML application, that requires an HTTP server to run. The easiest and quickest way to do this, is to execute the following command in a Terminal while in the frontend main folder, i.e. learning_machine/frontend:

python -m http.server 8282 --bind 127.0.0.1

This will run a simple HTTP webserver on the port 8282 and localhost address.

Testing the components up-and-running

To test the backend component, it is necessary to navigate the following address into a browser window:

If all is working, you should be able to access the Swagger API documentation page.

Similarly, to test that also the frontend component is correctly setup and running, please navigate the following address into a browser window: