App structure¶
When creating an app with the CLI, you will download the current GitHub folder with the following structure.
Important
The main class must be named App in app.py ins the src folder.
├── README.md # explains how to create an app
├── __init__.py
├── checkpoint
│ ├── __init__.py
│ └── model.pt: Optionnal # optional: model to be used in the app must be placed there
├── examples
│ ├── app_with_checkpoint.py # example: app example with checkpoint
│ └── torch_classifier.py # example: show how to train a neural network with pre-trained embeddings
└── src
├── DESC.md # Desciption file of the application, feel free to put a maximum of information.
├── __init__.py
├── app.py # main application script. The main class must be named App.
└── model.py: Optional # file to register the models you use in app.py.
└── tags.json # file to register the tags on the hub.
Special method in apps¶
Every apps inherit from the DeepChainApp class that provides some special method. This method is useful for loading extra files
in your app.
Use method
get_checkpoint_path(__file__)to get the absolute path of the file in thecheckpointfolder.Use method
get_filepath(__file__,file)to get the absolute path of the file in thesrcfolder.
DeepchainHub¶
All the applications that have been released publicly can be found on the hub as described in this section