Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit cc473ef

Browse files
chuyang-dengChuyang Dengnadiaya
authored
fix: change single quotes to double quotes (#149)
* ake quotes consistent * fix: change single-quotes to double-quotes * update quotes * remove hardcoded region * update test quotes Co-authored-by: Chuyang Deng <[email protected]> Co-authored-by: Nadia Yakimakha <[email protected]>
1 parent 2d2cfad commit cc473ef

18 files changed

+683
-684
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -620,24 +620,24 @@ To deploy a Multi-Model endpoint with TFS container, please start the container
620620
### Multi-Model Interfaces
621621
We provide four different interfaces for user to interact with a Multi-Model Mode container:
622622

623-
+---------------------+---------------------------------+---------------------------------------------+
624-
| Functionality | Request | Response/Actions |
625-
+---------------------+---------------------------------+---------------------------------------------+
626-
| List A Single Model | GET /models/{model_name} | Information about the specified model |
627-
+---------------------+---------------------------------+---------------------------------------------+
628-
| List All Models | GET /models | List of Information about all loaded models |
629-
+---------------------+---------------------------------+---------------------------------------------+
630-
| | POST /models | Load model with "model_name" from |
631-
| | data = { | specified url |
632-
| Load A Model | "model_name": <model-name>, | |
633-
| | "url": <path to model data> | |
634-
| | } | |
635-
+---------------------+---------------------------------+---------------------------------------------+
636-
| Make Invocations | POST /models/{model_name}/invoke| Return inference result from |
637-
| | data = <invocation payload> | the specified model |
638-
+---------------------+---------------------------------+---------------------------------------------+
639-
| Unload A Model | DELETE /models/{model_name} | Unload the specified model |
640-
+---------------------+---------------------------------+---------------------------------------------+
623+
+---------------------+---------------------------------+---------------------------------------------+
624+
| Functionality | Request | Response/Actions |
625+
+---------------------+---------------------------------+---------------------------------------------+
626+
| List A Single Model | GET /models/{model_name} | Information about the specified model |
627+
+---------------------+---------------------------------+---------------------------------------------+
628+
| List All Models | GET /models | List of Information about all loaded models |
629+
+---------------------+---------------------------------+---------------------------------------------+
630+
| | POST /models | Load model with "model_name" from |
631+
| | data = { | specified url |
632+
| Load A Model | "model_name": <model-name>, | |
633+
| | "url": <path to model data> | |
634+
| | } | |
635+
+---------------------+---------------------------------+---------------------------------------------+
636+
| Make Invocations | POST /models/{model_name}/invoke| Return inference result from |
637+
| | data = <invocation payload> | the specified model |
638+
+---------------------+---------------------------------+---------------------------------------------+
639+
| Unload A Model | DELETE /models/{model_name} | Unload the specified model |
640+
+---------------------+---------------------------------+---------------------------------------------+
641641

642642
### Maximum Number of Models
643643
Also please note the environment variable ``SAGEMAKER_SAFE_PORT_RANGE`` will limit the number of models that can be loaded to the endpoint at the same time.

docker/build_artifacts/deep_learning_container.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _validate_instance_id(instance_id):
2020
"""
2121
Validate instance ID
2222
"""
23-
instance_id_regex = r'^(i-\S{17})'
23+
instance_id_regex = r"^(i-\S{17})"
2424
compiled_regex = re.compile(instance_id_regex)
2525
match = compiled_regex.match(instance_id)
2626

docker/build_artifacts/dockerd-entrypoint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
import sys
1818

1919
if not os.path.exists("/opt/ml/input/config"):
20-
subprocess.call(['python', '/usr/local/bin/deep_learning_container.py', '&>/dev/null', '&'])
20+
subprocess.call(["python", "/usr/local/bin/deep_learning_container.py", "&>/dev/null", "&"])
2121

2222
subprocess.check_call(shlex.split(' '.join(sys.argv[1:])))

docker/build_artifacts/sagemaker/multi_model_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
import time
1616
from contextlib import contextmanager
1717

18-
MODEL_CONFIG_FILE = '/sagemaker/model-config.cfg'
19-
DEFAULT_LOCK_FILE = '/sagemaker/lock-file.lock'
18+
MODEL_CONFIG_FILE = "/sagemaker/model-config.cfg"
19+
DEFAULT_LOCK_FILE = "/sagemaker/lock-file.lock"
2020

2121

2222
@contextmanager
2323
def lock(path=DEFAULT_LOCK_FILE):
24-
f = open(path, 'w')
24+
f = open(path, "w")
2525
fd = f.fileno()
2626
fcntl.lockf(fd, fcntl.LOCK_EX)
2727

@@ -35,7 +35,7 @@ def lock(path=DEFAULT_LOCK_FILE):
3535
@contextmanager
3636
def timeout(seconds=60):
3737
def _raise_timeout_error(signum, frame):
38-
raise Exception(408, 'Timed out after {} seconds'.format(seconds))
38+
raise Exception(408, "Timed out after {} seconds".format(seconds))
3939

4040
try:
4141
signal.signal(signal.SIGALRM, _raise_timeout_error)

0 commit comments

Comments
 (0)