Deployed b1a66cb with MkDocs version: 1.3.0
This commit is contained in:
parent
0683061983
commit
7305d2ead3
38 changed files with 3566 additions and 2820 deletions
|
|
@ -6,9 +6,9 @@
|
|||
"source": [
|
||||
"# Harden and deploy your app\n",
|
||||
"\n",
|
||||
"Finally, it's time to deploy your model. But before you have to make sure you follow AI deployment [best-practices](https://se-ml.github.io/). In the past, this step was too often either the source of unexpected struggles, or worse, simply ignored.\n",
|
||||
"Finally, it's time to deploy your model. But before that, you have to make sure you follow AI deployment [best-practices](https://se-ml.github.io/). In the past, this step was too often either the source of unexpected struggles, or worse, simply ignored.\n",
|
||||
"\n",
|
||||
"With `GreatAI`, it has become a matter of 2 lines of code."
|
||||
"With `GreatAI`, it has become a matter of 4 lines of code."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -20,22 +20,22 @@
|
|||
"name": "stderr",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[38;5;226m2022-07-09 22:38:56 | WARNING | Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:38:56 | WARNING | Cannot find credentials files, defaulting to using ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:38:56 | WARNING | The selected tracing database (ParallelTinyDbDriver) is not recommended for production\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:38:56 | WARNING | Cannot find credentials files, defaulting to using LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | GreatAI (v0.1.0): configured ✅\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | 🔩 tracing_database: ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | 🔩 large_file_implementation: LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | 🔩 is_production: False\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | 🔩 should_log_exception_stack: True\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | 🔩 prediction_cache_size: 512\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | 🔩 dashboard_table_size: 20\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:38:56 | WARNING | You still need to check whether you follow all best practices before trusting your deployment.\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:38:56 | WARNING | > Find out more at https://se-ml.github.io/practices\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | Fetching cached versions of my-domain-predictor\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | Latest version of my-domain-predictor is 5 (from versions: 0, 1, 2, 3, 4, 5)\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:56 | INFO | File my-domain-predictor-5 found in cache\u001b[0m\n"
|
||||
"\u001b[38;5;226mEnvironment variable ENVIRONMENT is not set, defaulting to development mode ‼️\u001b[0m\n",
|
||||
"\u001b[38;5;226mCannot find credentials files, defaulting to using ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;226mThe selected tracing database (ParallelTinyDbDriver) is not recommended for production\u001b[0m\n",
|
||||
"\u001b[38;5;226mCannot find credentials files, defaulting to using LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39mGreatAI (v0.1.4): configured ✅\u001b[0m\n",
|
||||
"\u001b[38;5;39m 🔩 tracing_database: ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;39m 🔩 large_file_implementation: LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m 🔩 is_production: False\u001b[0m\n",
|
||||
"\u001b[38;5;39m 🔩 should_log_exception_stack: True\u001b[0m\n",
|
||||
"\u001b[38;5;39m 🔩 prediction_cache_size: 512\u001b[0m\n",
|
||||
"\u001b[38;5;39m 🔩 dashboard_table_size: 50\u001b[0m\n",
|
||||
"\u001b[38;5;226mYou still need to check whether you follow all best practices before trusting your deployment.\u001b[0m\n",
|
||||
"\u001b[38;5;226m> Find out more at https://se-ml.github.io/practices\u001b[0m\n",
|
||||
"\u001b[38;5;39mFetching cached versions of my-domain-predictor\u001b[0m\n",
|
||||
"\u001b[38;5;39mLatest version of my-domain-predictor is 9 (from versions: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)\u001b[0m\n",
|
||||
"\u001b[38;5;39mFile my-domain-predictor-9 found in cache\u001b[0m\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
@ -59,16 +59,16 @@
|
|||
{
|
||||
"data": {
|
||||
"text/plain": [
|
||||
"Trace[str]({ 'created': '2022-07-09T20:38:56.394746',\n",
|
||||
"Trace[str]({'created': '2022-07-12T13:34:26.743292',\n",
|
||||
" 'exception': None,\n",
|
||||
" 'feedback': None,\n",
|
||||
" 'logged_values': { 'arg:sentence:length': 29,\n",
|
||||
" 'arg:sentence:value': 'Mountains are just big rocks.'},\n",
|
||||
" 'models': [{'key': 'my-domain-predictor', 'version': 5}],\n",
|
||||
" 'original_execution_time_ms': 4.999,\n",
|
||||
" 'models': [{'key': 'my-domain-predictor', 'version': 9}],\n",
|
||||
" 'original_execution_time_ms': 6.9699,\n",
|
||||
" 'output': 'geography',\n",
|
||||
" 'tags': ['predict_domain', 'online', 'development'],\n",
|
||||
" 'trace_id': 'aad1f83d-a81f-4b8b-898e-d02f8076616f'})"
|
||||
" 'trace_id': 'c80bdee3-602b-49dd-a84d-6eef80127e5a'})"
|
||||
]
|
||||
},
|
||||
"execution_count": 2,
|
||||
|
|
@ -77,8 +77,16 @@
|
|||
}
|
||||
],
|
||||
"source": [
|
||||
"predict_domain(\"Mountains are just big rocks.\")\n",
|
||||
"# the original return value is under the 'output' key"
|
||||
"predict_domain(\"Mountains are just big rocks.\")"
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Notice how the original return value is under the `.output` key. Additionally, a plethora of metadata has been added which will be useful later on.\n",
|
||||
"\n",
|
||||
"Running your app in development-mode is as easy as executing `great-ai deploy.ipynb` from your terminal."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -90,33 +98,33 @@
|
|||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"\u001b[38;5;39m2022-07-09 22:38:58 | INFO | Converting notebook to Python script\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:58 | INFO | Found `predict_domain` to be the GreatAI app \u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:38:58 | INFO | Uvicorn running on http://0.0.0.0:6060 (Press CTRL+C to quit)\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:39:00 | WARNING | Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:39:00 | WARNING | Cannot find credentials files, defaulting to using ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:39:00 | WARNING | The selected tracing database (ParallelTinyDbDriver) is not recommended for production\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:39:00 | WARNING | Cannot find credentials files, defaulting to using LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | GreatAI (v0.1.0): configured ✅\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | 🔩 tracing_database: ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | 🔩 large_file_implementation: LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | 🔩 is_production: False\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | 🔩 should_log_exception_stack: True\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | 🔩 prediction_cache_size: 512\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | 🔩 dashboard_table_size: 20\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:39:00 | WARNING | You still need to check whether you follow all best practices before trusting your deployment.\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-09 22:39:00 | WARNING | > Find out more at https://se-ml.github.io/practices\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | Fetching cached versions of my-domain-predictor\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | Latest version of my-domain-predictor is 5 (from versions: 0, 1, 2, 3, 4, 5)\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | File my-domain-predictor-5 found in cache\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | Started server process [882179]\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | Waiting for application startup.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:00 | INFO | Application startup complete.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:28 | INFO | Converting notebook to Python script\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:29 | INFO | Found `predict_domain` to be the GreatAI app \u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:29 | INFO | Uvicorn running on http://0.0.0.0:6060 (Press CTRL+C to quit)\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-12 15:34:31 | WARNING | Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-12 15:34:31 | WARNING | Cannot find credentials files, defaulting to using ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-12 15:34:31 | WARNING | The selected tracing database (ParallelTinyDbDriver) is not recommended for production\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-12 15:34:31 | WARNING | Cannot find credentials files, defaulting to using LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | GreatAI (v0.1.4): configured ✅\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | 🔩 tracing_database: ParallelTinyDbDriver\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | 🔩 large_file_implementation: LargeFileLocal\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | 🔩 is_production: False\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | 🔩 should_log_exception_stack: True\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | 🔩 prediction_cache_size: 512\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | 🔩 dashboard_table_size: 50\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-12 15:34:31 | WARNING | You still need to check whether you follow all best practices before trusting your deployment.\u001b[0m\n",
|
||||
"\u001b[38;5;226m2022-07-12 15:34:31 | WARNING | > Find out more at https://se-ml.github.io/practices\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | Fetching cached versions of my-domain-predictor\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | Latest version of my-domain-predictor is 9 (from versions: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | File my-domain-predictor-9 found in cache\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | Started server process [199794]\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | Waiting for application startup.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:31 | INFO | Application startup complete.\u001b[0m\n",
|
||||
"^C\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:04 | INFO | Shutting down\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:04 | INFO | Waiting for application shutdown.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:04 | INFO | Application shutdown complete.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-09 22:39:04 | INFO | Finished server process [882179]\u001b[0m\n"
|
||||
"\u001b[38;5;39m2022-07-12 15:34:33 | INFO | Shutting down\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:33 | INFO | Waiting for application shutdown.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:33 | INFO | Application shutdown complete.\u001b[0m\n",
|
||||
"\u001b[38;5;39m2022-07-12 15:34:33 | INFO | Finished server process [199794]\u001b[0m\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
@ -129,16 +137,15 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Congrats, you've just created your first GreatAI service! 🎉\n",
|
||||
"\n",
|
||||
"Now that you've made sure your application is hardened enough for the intended use case, it is time to deploy it. The responsibilities of GreatAI end when it wraps your inference function and model into a production-ready service. You're given the freedom and responsibility to deploy this service. Fortunately, you (or your organisation) probably already has an established routine for deploying services.\n",
|
||||
"\n",
|
||||
"There are three main approaches to deploy a GreatAI service: For more info about them, check out [the deployment how-to](/how-to-guides/use-service)."
|
||||
]
|
||||
},
|
||||
{
|
||||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"### [Go back to the summary](/tutorial)"
|
||||
"There are three main approaches to deploy a GreatAI service: For more info about them, check out [the deployment how-to](/how-to-guides/use-service).\n",
|
||||
"\n",
|
||||
"For more thorough examples, see the [examples page](/examples/simple/data).\n",
|
||||
"\n",
|
||||
"### [Go back to the summary](/tutorial/#summary)"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -48,6 +48,19 @@
|
|||
|
||||
|
||||
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:site_name" content="">
|
||||
<meta property="og:url" content="">
|
||||
<meta property="og:description" content="Transform your prototype AI code into production-ready software.">
|
||||
<meta property="og:type" content="">
|
||||
<meta property="og:image" content=https://great-ai.scoutinscience.com/media/og-image.png>
|
||||
|
||||
<style>
|
||||
.jupyter-wrapper a {
|
||||
color: var(--md-typeset-a-color) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
|
@ -394,6 +407,20 @@
|
|||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../how-to-guides/install/" class="md-nav__link">
|
||||
Installation guide
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../how-to-guides/create-service/" class="md-nav__link">
|
||||
How to create a GreatAI service
|
||||
|
|
@ -644,7 +671,7 @@
|
|||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../examples/simple/data/" class="md-nav__link">
|
||||
Train a domain classifier on the semantic scholar dataset
|
||||
Simple example: data engineering
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -658,7 +685,7 @@
|
|||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../examples/simple/train/" class="md-nav__link">
|
||||
Train a domain classifier on the semantic scholar dataset
|
||||
Optimise and train a model
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -672,7 +699,7 @@
|
|||
|
||||
<li class="md-nav__item">
|
||||
<a href="../../examples/simple/deploy/" class="md-nav__link">
|
||||
Train a domain classifier on the semantic scholar dataset
|
||||
Hardening and deployment
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -752,6 +779,7 @@
|
|||
<article class="md-content__inner md-typeset">
|
||||
|
||||
|
||||
|
||||
<a href="deploy.ipynb" title="Download Notebook" class="md-content__button md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 20h14v-2H5m14-9h-4V3H9v6H5l7 7 7-7Z"/></svg>
|
||||
</a>
|
||||
|
|
@ -1801,8 +1829,8 @@ Licensed under the Apache License, Version 2.0.
|
|||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput " data-mime-type="text/markdown">
|
||||
<h1 id="harden-and-deploy-your-app">Harden and deploy your app<a class="anchor-link" href="#harden-and-deploy-your-app">¶</a></h1><p>Finally, it's time to deploy your model. But before you have to make sure you follow AI deployment <a href="https://se-ml.github.io/">best-practices</a>. In the past, this step was too often either the source of unexpected struggles, or worse, simply ignored.</p>
|
||||
<p>With <code>GreatAI</code>, it has become a matter of 2 lines of code.</p>
|
||||
<h1 id="harden-and-deploy-your-app">Harden and deploy your app<a class="anchor-link" href="#harden-and-deploy-your-app">¶</a></h1><p>Finally, it's time to deploy your model. But before that, you have to make sure you follow AI deployment <a href="https://se-ml.github.io/">best-practices</a>. In the past, this step was too often either the source of unexpected struggles, or worse, simply ignored.</p>
|
||||
<p>With <code>GreatAI</code>, it has become a matter of 4 lines of code.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1868,22 +1896,22 @@ def predict_domain(sentence, model):
|
|||
|
||||
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="application/vnd.jupyter.stderr">
|
||||
<pre><span style="color: rgb(255,255,0)">2022-07-09 22:38:56 | WARNING | Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:38:56 | WARNING | Cannot find credentials files, defaulting to using ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:38:56 | WARNING | The selected tracing database (ParallelTinyDbDriver) is not recommended for production</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:38:56 | WARNING | Cannot find credentials files, defaulting to using LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | GreatAI (v0.1.0): configured ✅</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | 🔩 tracing_database: ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | 🔩 large_file_implementation: LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | 🔩 is_production: False</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | 🔩 should_log_exception_stack: True</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | 🔩 prediction_cache_size: 512</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | 🔩 dashboard_table_size: 20</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:38:56 | WARNING | You still need to check whether you follow all best practices before trusting your deployment.</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:38:56 | WARNING | > Find out more at https://se-ml.github.io/practices</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | Fetching cached versions of my-domain-predictor</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | Latest version of my-domain-predictor is 5 (from versions: 0, 1, 2, 3, 4, 5)</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:56 | INFO | File my-domain-predictor-5 found in cache</span>
|
||||
<pre><span style="color: rgb(255,255,0)">Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️</span>
|
||||
<span style="color: rgb(255,255,0)">Cannot find credentials files, defaulting to using ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(255,255,0)">The selected tracing database (ParallelTinyDbDriver) is not recommended for production</span>
|
||||
<span style="color: rgb(255,255,0)">Cannot find credentials files, defaulting to using LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">GreatAI (v0.1.4): configured ✅</span>
|
||||
<span style="color: rgb(0,175,255)"> 🔩 tracing_database: ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(0,175,255)"> 🔩 large_file_implementation: LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)"> 🔩 is_production: False</span>
|
||||
<span style="color: rgb(0,175,255)"> 🔩 should_log_exception_stack: True</span>
|
||||
<span style="color: rgb(0,175,255)"> 🔩 prediction_cache_size: 512</span>
|
||||
<span style="color: rgb(0,175,255)"> 🔩 dashboard_table_size: 50</span>
|
||||
<span style="color: rgb(255,255,0)">You still need to check whether you follow all best practices before trusting your deployment.</span>
|
||||
<span style="color: rgb(255,255,0)">> Find out more at https://se-ml.github.io/practices</span>
|
||||
<span style="color: rgb(0,175,255)">Fetching cached versions of my-domain-predictor</span>
|
||||
<span style="color: rgb(0,175,255)">Latest version of my-domain-predictor is 9 (from versions: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)</span>
|
||||
<span style="color: rgb(0,175,255)">File my-domain-predictor-9 found in cache</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1915,10 +1943,8 @@ def predict_domain(sentence, model):
|
|||
</clipboard-copy>
|
||||
</div>
|
||||
<div class="highlight-ipynb hl-python"><pre><span></span><span class="n">predict_domain</span><span class="p">(</span><span class="s2">"Mountains are just big rocks."</span><span class="p">)</span>
|
||||
<span class="c1"># the original return value is under the 'output' key</span>
|
||||
</pre></div>
|
||||
<div id="cell-2" class="clipboard-copy-txt">predict_domain("Mountains are just big rocks.")
|
||||
# the original return value is under the 'output' key</div>
|
||||
<div id="cell-2" class="clipboard-copy-txt">predict_domain("Mountains are just big rocks.")</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -1942,16 +1968,16 @@ def predict_domain(sentence, model):
|
|||
|
||||
|
||||
<div class="jp-RenderedText jp-OutputArea-output jp-OutputArea-executeResult" data-mime-type="text/plain">
|
||||
<pre>Trace[str]({ 'created': '2022-07-09T20:38:56.394746',
|
||||
<pre>Trace[str]({'created': '2022-07-12T13:34:26.743292',
|
||||
'exception': None,
|
||||
'feedback': None,
|
||||
'logged_values': { 'arg:sentence:length': 29,
|
||||
'arg:sentence:value': 'Mountains are just big rocks.'},
|
||||
'models': [{'key': 'my-domain-predictor', 'version': 5}],
|
||||
'original_execution_time_ms': 4.999,
|
||||
'models': [{'key': 'my-domain-predictor', 'version': 9}],
|
||||
'original_execution_time_ms': 6.9699,
|
||||
'output': 'geography',
|
||||
'tags': ['predict_domain', 'online', 'development'],
|
||||
'trace_id': 'aad1f83d-a81f-4b8b-898e-d02f8076616f'})</pre>
|
||||
'trace_id': 'c80bdee3-602b-49dd-a84d-6eef80127e5a'})</pre>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
@ -1960,6 +1986,19 @@ def predict_domain(sentence, model):
|
|||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell">
|
||||
<div class="jp-Cell-inputWrapper">
|
||||
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput " data-mime-type="text/markdown">
|
||||
<p>Notice how the original return value is under the <code>.output</code> key. Additionally, a plethora of metadata has been added which will be useful later on.</p>
|
||||
<p>Running your app in development-mode is as easy as executing <code>great-ai deploy.ipynb</code> from your terminal.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><div class="jp-Cell jp-CodeCell jp-Notebook-cell ">
|
||||
<div class="jp-Cell jp-CodeCell jp-Notebook-cell ">
|
||||
|
|
@ -2008,33 +2047,33 @@ def predict_domain(sentence, model):
|
|||
|
||||
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="text/plain">
|
||||
<pre><span style="color: rgb(0,175,255)">2022-07-09 22:38:58 | INFO | Converting notebook to Python script</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:58 | INFO | Found `predict_domain` to be the GreatAI app </span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:38:58 | INFO | Uvicorn running on http://0.0.0.0:6060 (Press CTRL+C to quit)</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:39:00 | WARNING | Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:39:00 | WARNING | Cannot find credentials files, defaulting to using ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:39:00 | WARNING | The selected tracing database (ParallelTinyDbDriver) is not recommended for production</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:39:00 | WARNING | Cannot find credentials files, defaulting to using LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | GreatAI (v0.1.0): configured ✅</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | 🔩 tracing_database: ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | 🔩 large_file_implementation: LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | 🔩 is_production: False</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | 🔩 should_log_exception_stack: True</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | 🔩 prediction_cache_size: 512</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | 🔩 dashboard_table_size: 20</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:39:00 | WARNING | You still need to check whether you follow all best practices before trusting your deployment.</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-09 22:39:00 | WARNING | > Find out more at https://se-ml.github.io/practices</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | Fetching cached versions of my-domain-predictor</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | Latest version of my-domain-predictor is 5 (from versions: 0, 1, 2, 3, 4, 5)</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | File my-domain-predictor-5 found in cache</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | Started server process [882179]</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | Waiting for application startup.</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:00 | INFO | Application startup complete.</span>
|
||||
<pre><span style="color: rgb(0,175,255)">2022-07-12 15:34:28 | INFO | Converting notebook to Python script</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:29 | INFO | Found `predict_domain` to be the GreatAI app </span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:29 | INFO | Uvicorn running on http://0.0.0.0:6060 (Press CTRL+C to quit)</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-12 15:34:31 | WARNING | Environment variable ENVIRONMENT is not set, defaulting to development mode ‼️</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-12 15:34:31 | WARNING | Cannot find credentials files, defaulting to using ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-12 15:34:31 | WARNING | The selected tracing database (ParallelTinyDbDriver) is not recommended for production</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-12 15:34:31 | WARNING | Cannot find credentials files, defaulting to using LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | GreatAI (v0.1.4): configured ✅</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | 🔩 tracing_database: ParallelTinyDbDriver</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | 🔩 large_file_implementation: LargeFileLocal</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | 🔩 is_production: False</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | 🔩 should_log_exception_stack: True</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | 🔩 prediction_cache_size: 512</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | 🔩 dashboard_table_size: 50</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-12 15:34:31 | WARNING | You still need to check whether you follow all best practices before trusting your deployment.</span>
|
||||
<span style="color: rgb(255,255,0)">2022-07-12 15:34:31 | WARNING | > Find out more at https://se-ml.github.io/practices</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | Fetching cached versions of my-domain-predictor</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | Latest version of my-domain-predictor is 9 (from versions: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9)</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | File my-domain-predictor-9 found in cache</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | Started server process [199794]</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | Waiting for application startup.</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:31 | INFO | Application startup complete.</span>
|
||||
^C
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:04 | INFO | Shutting down</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:04 | INFO | Waiting for application shutdown.</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:04 | INFO | Application shutdown complete.</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-09 22:39:04 | INFO | Finished server process [882179]</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:33 | INFO | Shutting down</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:33 | INFO | Waiting for application shutdown.</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:33 | INFO | Application shutdown complete.</span>
|
||||
<span style="color: rgb(0,175,255)">2022-07-12 15:34:33 | INFO | Finished server process [199794]</span>
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2051,20 +2090,11 @@ def predict_domain(sentence, model):
|
|||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput " data-mime-type="text/markdown">
|
||||
<p>Congrats, you've just created your first GreatAI service! 🎉</p>
|
||||
<p>Now that you've made sure your application is hardened enough for the intended use case, it is time to deploy it. The responsibilities of GreatAI end when it wraps your inference function and model into a production-ready service. You're given the freedom and responsibility to deploy this service. Fortunately, you (or your organisation) probably already has an established routine for deploying services.</p>
|
||||
<p>There are three main approaches to deploy a GreatAI service: For more info about them, check out <a href="/how-to-guides/use-service">the deployment how-to</a>.</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell">
|
||||
<div class="jp-Cell-inputWrapper">
|
||||
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
|
||||
</div>
|
||||
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
|
||||
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput " data-mime-type="text/markdown">
|
||||
<h3 id="go-back-to-the-summary"><a href="/tutorial">Go back to the summary</a><a class="anchor-link" href="#go-back-to-the-summary">¶</a></h3>
|
||||
<p>For more thorough examples, see the <a href="/examples/simple/data">examples page</a>.</p>
|
||||
<h3 id="go-back-to-the-summary"><a href="/tutorial/#summary">Go back to the summary</a><a class="anchor-link" href="#go-back-to-the-summary">¶</a></h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -2078,7 +2108,7 @@ def predict_domain(sentence, model):
|
|||
<small>
|
||||
|
||||
Last update:
|
||||
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 11, 2022</span>
|
||||
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 12, 2022</span>
|
||||
|
||||
|
||||
</small>
|
||||
|
|
@ -2115,13 +2145,13 @@ def predict_domain(sentence, model):
|
|||
|
||||
|
||||
|
||||
<a href="../../how-to-guides/create-service/" class="md-footer__link md-footer__link--next" aria-label="Next: How to create a GreatAI service" rel="next">
|
||||
<a href="../../how-to-guides/install/" class="md-footer__link md-footer__link--next" aria-label="Next: Installation guide" rel="next">
|
||||
<div class="md-footer__title">
|
||||
<div class="md-ellipsis">
|
||||
<span class="md-footer__direction">
|
||||
Next
|
||||
</span>
|
||||
How to create a GreatAI service
|
||||
Installation guide
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-footer__button md-icon">
|
||||
|
|
|
|||
|
|
@ -48,6 +48,19 @@
|
|||
|
||||
|
||||
|
||||
<meta property="og:title" content="">
|
||||
<meta property="og:site_name" content="">
|
||||
<meta property="og:url" content="">
|
||||
<meta property="og:description" content="Transform your prototype AI code into production-ready software.">
|
||||
<meta property="og:type" content="">
|
||||
<meta property="og:image" content=https://great-ai.scoutinscience.com/media/og-image.png>
|
||||
|
||||
<style>
|
||||
.jupyter-wrapper a {
|
||||
color: var(--md-typeset-a-color) !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
|
||||
|
|
@ -334,15 +347,15 @@
|
|||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-training-notebook" class="md-nav__link">
|
||||
The training notebook
|
||||
<a href="#training-notebook" class="md-nav__link">
|
||||
Training notebook
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-deployment-notebook" class="md-nav__link">
|
||||
The deployment notebook
|
||||
<a href="#deployment-notebook" class="md-nav__link">
|
||||
Deployment notebook
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
|
@ -428,6 +441,20 @@
|
|||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../how-to-guides/install/" class="md-nav__link">
|
||||
Installation guide
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="../how-to-guides/create-service/" class="md-nav__link">
|
||||
How to create a GreatAI service
|
||||
|
|
@ -678,7 +705,7 @@
|
|||
|
||||
<li class="md-nav__item">
|
||||
<a href="../examples/simple/data/" class="md-nav__link">
|
||||
Train a domain classifier on the semantic scholar dataset
|
||||
Simple example: data engineering
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -692,7 +719,7 @@
|
|||
|
||||
<li class="md-nav__item">
|
||||
<a href="../examples/simple/train/" class="md-nav__link">
|
||||
Train a domain classifier on the semantic scholar dataset
|
||||
Optimise and train a model
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -706,7 +733,7 @@
|
|||
|
||||
<li class="md-nav__item">
|
||||
<a href="../examples/simple/deploy/" class="md-nav__link">
|
||||
Train a domain classifier on the semantic scholar dataset
|
||||
Hardening and deployment
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
|
@ -790,15 +817,15 @@
|
|||
<ul class="md-nav__list">
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-training-notebook" class="md-nav__link">
|
||||
The training notebook
|
||||
<a href="#training-notebook" class="md-nav__link">
|
||||
Training notebook
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
||||
<li class="md-nav__item">
|
||||
<a href="#the-deployment-notebook" class="md-nav__link">
|
||||
The deployment notebook
|
||||
<a href="#deployment-notebook" class="md-nav__link">
|
||||
Deployment notebook
|
||||
</a>
|
||||
|
||||
</li>
|
||||
|
|
@ -822,6 +849,7 @@
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="https://github.com/schmelczer/great-ai/edit/main/docs/tutorial/index.md" title="Edit this page" class="md-content__button md-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25Z"/></svg>
|
||||
|
|
@ -830,11 +858,11 @@
|
|||
|
||||
|
||||
<h1 id="train-and-deploy-a-sota-model">Train and deploy a SOTA model<a class="headerlink" href="#train-and-deploy-a-sota-model" title="Permanent link">#</a></h1>
|
||||
<p>Let's see GreatAI in action by going over the life-cycle of a simple service.</p>
|
||||
<p>Let's see <code>great-ai</code> in action by going over the life-cycle of a simple service.</p>
|
||||
<h2 id="objectives">Objectives<a class="headerlink" href="#objectives" title="Permanent link">#</a></h2>
|
||||
<ol>
|
||||
<li>You will see how the [great_ai.utilities][] can integrate into your Data Science workflow.</li>
|
||||
<li>You will use [great_ai.large_file][] to version and store your trained model.</li>
|
||||
<li>You will see how the <a href="/reference/utilities">great_ai.utilities</a> can integrate into your Data Science workflow.</li>
|
||||
<li>You will use <a href="/reference/large_file">great_ai.large_file</a> to version and store your trained model.</li>
|
||||
<li>You will use <a class="autorefs autorefs-internal" href="../reference/#great_ai.GreatAI">GreatAI</a> to prepare your model for a robust and responsible deployment.</li>
|
||||
</ol>
|
||||
<h2 id="overview">Overview<a class="headerlink" href="#overview" title="Permanent link">#</a></h2>
|
||||
|
|
@ -849,13 +877,13 @@
|
|||
<p><a class="md-button md-button--primary" href="deploy/"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6 20a6 6 0 0 1-6-6c0-3.09 2.34-5.64 5.35-5.96A7.496 7.496 0 0 1 12 4a7.5 7.5 0 0 1 7.35 6A5.02 5.02 0 0 1 24 15a5 5 0 0 1-5 5H6M9.09 8.4 4.5 13l4.59 4.6 1.41-1.42L7.32 13l3.18-3.18L9.09 8.4m5.82 0L13.5 9.82 16.68 13l-3.18 3.18 1.41 1.42L19.5 13l-4.59-4.6Z"/></svg></span> Deploy it</a></p>
|
||||
</div>
|
||||
<h2 id="summary">Summary<a class="headerlink" href="#summary" title="Permanent link">#</a></h2>
|
||||
<h3 id="the-training-notebook">The <a href="train/">training notebook</a><a class="headerlink" href="#the-training-notebook" title="Permanent link">#</a></h3>
|
||||
<p>We load and preprocess the dataset while relying on [great_ai.utilities.clean][] for the heavy-lifting. Additionally, the preprocessing is parallelised using <a class="autorefs autorefs-internal" href="../reference/utilities/#great_ai.utilities.simple_parallel_map">great_ai.utilities.simple_parallel_map</a></p>
|
||||
<h3 id="training-notebook"><a href="train/">Training notebook</a><a class="headerlink" href="#training-notebook" title="Permanent link">#</a></h3>
|
||||
<p>We load and preprocess the dataset while relying on <a class="autorefs autorefs-internal" href="../reference/utilities/#great_ai.utilities.clean.clean">great_ai.utilities.clean</a> for doing the heavy-lifting. Additionally, the preprocessing is parallelised using <a class="autorefs autorefs-internal" href="../reference/utilities/#great_ai.utilities.simple_parallel_map">great_ai.utilities.simple_parallel_map</a></p>
|
||||
<p>After training and evaluating a model, it is exported using <a class="autorefs autorefs-internal" href="../reference/#great_ai.save_model">great_ai.save_model</a>.</p>
|
||||
<details class="tip">
|
||||
<summary>Remote storage</summary>
|
||||
<p>To store your model remotely, you need to set your credentials before calling <code>save_model</code>.</p>
|
||||
<p>For example, to use <a href="https://aws.amazon.com/s3/">AWS S3</a>:
|
||||
<p>For example, to use <a href="https://aws.amazon.com/s3" target="_blank">AWS S3</a>:
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="kn">from</span> <span class="nn">great_ai.large_file</span> <span class="kn">import</span> <span class="n">LargeFileS3</span>
|
||||
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>
|
||||
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="n">LargeFileS3</span><span class="o">.</span><span class="n">configure</span><span class="p">(</span>
|
||||
|
|
@ -869,8 +897,9 @@
|
|||
<a id="__codelineno-0-11" name="__codelineno-0-11" href="#__codelineno-0-11"></a>
|
||||
<a id="__codelineno-0-12" name="__codelineno-0-12" href="#__codelineno-0-12"></a><span class="n">save_model</span><span class="p">(</span><span class="n">model</span><span class="p">,</span> <span class="n">key</span><span class="o">=</span><span class="s1">'my-domain-predictor'</span><span class="p">)</span>
|
||||
</code></pre></div></p>
|
||||
<p>For more info, checkout <a href="/how-to-guides/configure-service">the configuration how-to page</a>.</p>
|
||||
</details>
|
||||
<h3 id="the-deployment-notebook">The <a href="deploy/">deployment notebook</a><a class="headerlink" href="#the-deployment-notebook" title="Permanent link">#</a></h3>
|
||||
<h3 id="deployment-notebook"><a href="deploy/">Deployment notebook</a><a class="headerlink" href="#deployment-notebook" title="Permanent link">#</a></h3>
|
||||
<p>We create an inference function that can be hardened by wrapping it in a <a class="autorefs autorefs-internal" href="../reference/#great_ai.GreatAI">GreatAI</a> instance.</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a><span class="kn">from</span> <span class="nn">great_ai</span> <span class="kn">import</span> <span class="n">GreatAI</span><span class="p">,</span> <span class="n">use_model</span>
|
||||
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a><span class="kn">from</span> <span class="nn">great_ai.utilities</span> <span class="kn">import</span> <span class="n">clean</span>
|
||||
|
|
@ -883,16 +912,20 @@
|
|||
</code></pre></div>
|
||||
<ol>
|
||||
<li><a class="autorefs autorefs-internal" href="../reference/#great_ai.use_model">@use_model</a> loads and injects your model into the <code>predict_domain</code> function's <code>model</code> argument.
|
||||
You can freely reference it knowing that it is always given to the function.</li>
|
||||
You can freely reference it knowing that the function is always provided with it.</li>
|
||||
</ol>
|
||||
<p>Finally, we test the model's inference function through the GreatAI dashboard. <a href="/how-to-guides/use-service">The only thing left is to deploy the hardened-service.</a></p>
|
||||
<p>Finally, we test the model's inference function through the GreatAI dashboard. <a href="/how-to-guides/use-service">The only thing left is to deploy the hardened-service properly.</a></p>
|
||||
<div style="display: flex; justify-content: center;">
|
||||
<p><a class="md-button md-button--primary" href="/how-to-guides/create-service"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18 22a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2h-6v7L9.5 7.5 7 9V2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12Z"/></svg></span> Learn about all the features</a></p>
|
||||
<p><a class="md-button md-button--secondary" href="/examples/simple/data"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2v2h1v14a4 4 0 0 0 4 4 4 4 0 0 0 4-4V4h1V2H7m4 14c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1m2-4c-.6 0-1-.4-1-1s.4-1 1-1 1 .4 1 1-.4 1-1 1m1-5h-4V4h4v3Z"/></svg></span> Look at more examples</a></p>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="md-source-file">
|
||||
<small>
|
||||
|
||||
Last update:
|
||||
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 11, 2022</span>
|
||||
<span class="git-revision-date-localized-plugin git-revision-date-localized-plugin-date">July 12, 2022</span>
|
||||
|
||||
|
||||
</small>
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
# Train and deploy a SOTA model
|
||||
|
||||
Let's see GreatAI in action by going over the life-cycle of a simple service.
|
||||
Let's see `great-ai` in action by going over the life-cycle of a simple service.
|
||||
|
||||
## Objectives
|
||||
|
||||
1. You will see how the [great_ai.utilities][] can integrate into your Data Science workflow.
|
||||
2. You will use [great_ai.large_file][] to version and store your trained model.
|
||||
1. You will see how the [great_ai.utilities](/reference/utilities) can integrate into your Data Science workflow.
|
||||
2. You will use [great_ai.large_file](/reference/large_file) to version and store your trained model.
|
||||
3. You will use [GreatAI][great_ai.GreatAI] to prepare your model for a robust and responsible deployment.
|
||||
|
||||
## Overview
|
||||
|
|
@ -14,7 +14,6 @@ You are going to train a field of study (domain) classifier for scientific sente
|
|||
|
||||
We use the same synthetic dataset derived from the [Microsoft Academic Graph](https://www.microsoft.com/en-us/research/project/microsoft-academic-graph/). The dataset is [available here](https://github.com/allenai/scibert/tree/master/data/text_classification/mag).
|
||||
|
||||
|
||||
!!! success
|
||||
You are ready to start the tutorial. Feel free to come back to the [summary](#summary) section once you're finished.
|
||||
|
||||
|
|
@ -24,19 +23,18 @@ We use the same synthetic dataset derived from the [Microsoft Academic Graph](ht
|
|||
[:material-cloud-tags: Deploy it](deploy.ipynb){ .md-button .md-button--primary }
|
||||
</div>
|
||||
|
||||
|
||||
## Summary
|
||||
|
||||
### The [training notebook](train.ipynb)
|
||||
### [Training notebook](train.ipynb)
|
||||
|
||||
We load and preprocess the dataset while relying on [great_ai.utilities.clean][] for the heavy-lifting. Additionally, the preprocessing is parallelised using [great_ai.utilities.simple_parallel_map][]
|
||||
We load and preprocess the dataset while relying on [great_ai.utilities.clean][great_ai.utilities.clean.clean] for doing the heavy-lifting. Additionally, the preprocessing is parallelised using [great_ai.utilities.simple_parallel_map][]
|
||||
|
||||
After training and evaluating a model, it is exported using [great_ai.save_model][].
|
||||
|
||||
??? tip "Remote storage"
|
||||
To store your model remotely, you need to set your credentials before calling `save_model`.
|
||||
|
||||
For example, to use [AWS S3](https://aws.amazon.com/s3/):
|
||||
For example, to use [AWS S3](https://aws.amazon.com/s3){ target=_blank }:
|
||||
```python
|
||||
from great_ai.large_file import LargeFileS3
|
||||
|
||||
|
|
@ -52,7 +50,9 @@ After training and evaluating a model, it is exported using [great_ai.save_model
|
|||
save_model(model, key='my-domain-predictor')
|
||||
```
|
||||
|
||||
### The [deployment notebook](deploy.ipynb)
|
||||
For more info, checkout [the configuration how-to page](/how-to-guides/configure-service).
|
||||
|
||||
### [Deployment notebook](deploy.ipynb)
|
||||
|
||||
We create an inference function that can be hardened by wrapping it in a [GreatAI][great_ai.GreatAI] instance.
|
||||
|
||||
|
|
@ -68,6 +68,12 @@ def predict_domain(sentence, model):
|
|||
```
|
||||
|
||||
1. [@use_model][great_ai.use_model] loads and injects your model into the `predict_domain` function's `model` argument.
|
||||
You can freely reference it knowing that it is always given to the function.
|
||||
You can freely reference it knowing that the function is always provided with it.
|
||||
|
||||
Finally, we test the model's inference function through the GreatAI dashboard. [The only thing left is to deploy the hardened-service.](/how-to-guides/use-service)
|
||||
Finally, we test the model's inference function through the GreatAI dashboard. [The only thing left is to deploy the hardened-service properly.](/how-to-guides/use-service)
|
||||
|
||||
<div style="display: flex; justify-content: center;" markdown>
|
||||
[:material-book: Learn about all the features](/how-to-guides/create-service){ .md-button .md-button--primary }
|
||||
|
||||
[:material-test-tube: Look at more examples](/examples/simple/data){ .md-button .md-button--secondary }
|
||||
</div>
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue