File tree Expand file tree Collapse file tree 4 files changed +26
-3
lines changed
model_server/multi_model_server Expand file tree Collapse file tree 4 files changed +26
-3
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,5 @@ accelerate>=0.24.1,<=0.27.0
2
2
sagemaker_schema_inference_artifacts>=0.0.5
3
3
uvicorn>=0.30.1
4
4
fastapi>=0.111.0
5
- nest-asyncio
5
+ nest-asyncio
6
+ transformers
Original file line number Diff line number Diff line change @@ -58,5 +58,5 @@ async def main():
58
58
use_colors = True ,
59
59
)
60
60
server = uvicorn .Server (config )
61
- logger .info ("I'm just waiting for a connection" )
61
+ logger .info ("Waiting for a connection... " )
62
62
await server .serve ()
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Entry point for running the service locally
4
+
5
+ # Verify if uvicorn and fastapi are installed
6
+ if ! command -v uvicorn & > /dev/null
7
+ then
8
+ echo " uvicorn could not be found, installing..."
9
+ pip install " uvicorn[standard]"
10
+ fi
11
+
12
+ echo " Starting the service locally"
13
+ uvicorn $1 :app --port 9007 --host 0.0.0.0 --reload &
14
+ UVICORN_PID=$!
15
+
16
+ echo $UVICORN_PID
17
+
18
+ echo " Wait for the service to be completely ready"
19
+ # uvicorn takes couple of seconds to launch the service
20
+ sleep 10
21
+
22
+ exit 0
Original file line number Diff line number Diff line change 16
16
from sagemaker .s3 import S3Uploader
17
17
from sagemaker .local .utils import get_docker_host
18
18
from sagemaker .serve .utils .optimize_utils import _is_s3_uri
19
- from sagemaker .app import main
19
+ from sagemaker .serve . app import main
20
20
21
21
MODE_DIR_BINDING = "/opt/ml/model/"
22
22
_DEFAULT_ENV_VARS = {}
You can’t perform that action at this time.
0 commit comments