Skip to content

Commit

Permalink
remove custom environment (#2445)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuke444 authored Jul 12, 2023
1 parent 0973f48 commit d18daba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@ def iterate(obj):
def get_safe_response(result):
jsonable_result = _get_jsonable_obj(result, pandas_orient="records")

print(jsonable_result)
return iterate(jsonable_result)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,48 +340,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"##### 3.3 Create environment for Llama endpoint\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"from IPython.core.display import display, HTML\n",
"from azure.ai.ml.entities import Environment, BuildContext\n",
"\n",
"try:\n",
" env = ml_client.environments.get(environment_name, label=\"latest\")\n",
" print(\"---Environment already exists---\")\n",
"except:\n",
" print(\"---Creating environment---\")\n",
" env = Environment(\n",
" name=environment_name, build=BuildContext(path=\"./llama-files/docker_env\")\n",
" )\n",
" ml_client.environments.create_or_update(env)\n",
" env = ml_client.environments.get(environment_name, label=\"latest\")\n",
" print(\"---Please use link below to check build status---\")\n",
"\n",
"\n",
"display(\n",
" HTML(\n",
" f\"\"\"\n",
" <a href=\"https://ml.azure.com/environments/{environment_name}/version/{env.version}?wsid=/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.MachineLearningServices/workspaces/{workspace}\">\n",
" Click here to check env build status in AML studio\n",
" </a>\n",
" \"\"\"\n",
" )\n",
")"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"##### 3.4 Deploy Llama model\n",
"##### 3.3 Deploy Llama model\n",
"This step may take a few minutes."
]
},
Expand All @@ -397,7 +356,6 @@
" ManagedOnlineDeployment,\n",
" ProbeSettings,\n",
")\n",
"import os\n",
"\n",
"# Define the deployment\n",
"# Update the model version as necessary\n",
Expand All @@ -410,24 +368,20 @@
" code_configuration=CodeConfiguration(\n",
" code=\"./llama-files/score\", scoring_script=\"score.py\"\n",
" ),\n",
" environment=env,\n",
" environment_variables={\n",
" \"MLFLOW_MODEL_FOLDER\": os.path.basename(llama_model.path),\n",
" \"CONTENT_SAFETY_ENDPOINT\": aacs_endpoint,\n",
" \"CONTENT_SAFETY_KEY\": aacs_access_key,\n",
" },\n",
" request_settings=OnlineRequestSettings(request_timeout_ms=90000),\n",
" liveness_probe=ProbeSettings(\n",
" failure_threshold=30,\n",
" success_threshold=1,\n",
" timeout=300,\n",
" period=100,\n",
" initial_delay=500,\n",
" ),\n",
" readiness_probe=ProbeSettings(\n",
" failure_threshold=30,\n",
" success_threshold=1,\n",
" timeout=300,\n",
" period=100,\n",
" initial_delay=500,\n",
" ),\n",
Expand Down

0 comments on commit d18daba

Please sign in to comment.