mirror of
https://github.com/GokuMohandas/Made-With-ML.git
synced 2026-03-11 17:46:49 -05:00
ML for Developers
This commit is contained in:
17
deploy/services/serve_model.py
Normal file
17
deploy/services/serve_model.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
sys.path.append(".")
|
||||
|
||||
from madewithml.config import MODEL_REGISTRY # NOQA: E402
|
||||
from madewithml.serve import ModelDeployment # NOQA: E402
|
||||
|
||||
# Copy from S3
|
||||
github_username = os.environ.get("GITHUB_USERNAME")
|
||||
subprocess.check_output(["aws", "s3", "cp", f"s3://madewithml/{github_username}/mlflow/", str(MODEL_REGISTRY), "--recursive"])
|
||||
subprocess.check_output(["aws", "s3", "cp", f"s3://madewithml/{github_username}/results/", "./", "--recursive"])
|
||||
|
||||
# Entrypoint
|
||||
run_id = [line.strip() for line in open("run_id.txt")][0]
|
||||
entrypoint = ModelDeployment.bind(run_id=run_id, threshold=0.9)
|
||||
12
deploy/services/serve_model.yaml
Normal file
12
deploy/services/serve_model.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
name: madewithml
|
||||
project_id: prj_v9izs5t1d6b512ism8c5rkq4wm
|
||||
cluster_env: madewithml-cluster-env
|
||||
compute_config: madewithml-cluster-compute
|
||||
ray_serve_config:
|
||||
import_path: deploy.services.serve_model:entrypoint
|
||||
runtime_env:
|
||||
working_dir: .
|
||||
upload_path: s3://madewithml/GokuMohandas/services # <--- CHANGE USERNAME (case-sensitive)
|
||||
env_vars:
|
||||
GITHUB_USERNAME: GokuMohandas # <--- CHANGE USERNAME (case-sensitive)
|
||||
rollout_strategy: ROLLOUT # ROLLOUT or IN_PLACE
|
||||
Reference in New Issue
Block a user