added model documentation
This commit is contained in:
@ -1 +1,56 @@
|
||||
<p>documentation-models works!</p>
|
||||
<h4>Model file upload</h4>
|
||||
|
||||
<p>
|
||||
Model files have to be saved as a .pkl file in 80_Modelle_BIC. <br>
|
||||
For upload the upload script has to be opened (can be in every environment). The name of the model file has to be
|
||||
entered wih the .pkl ending in the first command and without .pkl in the second.
|
||||
</p>
|
||||
|
||||
<h4 class="space-above">Adding new model scripts</h4>
|
||||
|
||||
<p>
|
||||
Open Spyder in the base environment and open the model.py within.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Enter model file name without .pkl in fetchData</li>
|
||||
<li>Add new prediction function below others</li>
|
||||
<li>duplicate another @app.route and rename according to desired route name and prediction function name</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="space-above">Testing locally</h4>
|
||||
|
||||
<p>
|
||||
To test the model Python script locally, you need to execute it in the base environment, in which all necessary
|
||||
packages have to be installed. Note that Spyder also has to be opened in the base environment.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Open a separate Anaconda Prompt and cd into the definma-UI folder</li>
|
||||
<li>Adapt the model-mock.json at definma-UI/assets/ and enter the new model URL and name</li>
|
||||
<li>Execute "python -m http.server" in the Anaconda Prompt</li>
|
||||
<li>Execute the model.py script in Spyder</li>
|
||||
<li>Navigate to <a href="http://localhost:8000">http://localhost:8000</a> in the browser</li>
|
||||
<li>If there are problems with cached data, open the Browser developer console (Ctrl+Shift+I) and tick
|
||||
"Disable cache" in the Network tab. The console then has to stay open.</li>
|
||||
</ul>
|
||||
|
||||
<h4 class="space-above">Model script upload</h4>
|
||||
|
||||
In the Windows Powershell:
|
||||
|
||||
<ul>
|
||||
<li>cf login (only at the first time)</li>
|
||||
<li>API endpoint: https://api.sys.de1.bosch-iot-cloud.com</li>
|
||||
<li>Enter email with .de.bosch.com</li>
|
||||
<li>Enter BIC password</li>
|
||||
<li>Select space to upload to (currently 3 - development)</li>
|
||||
<li>cd into the folder containing the manifest.yaml (here is also model.py)</li>
|
||||
<li>cf push</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
After upload the new model details have to be entered in the UI.
|
||||
</p>
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user