Skip to content

Commit f9a0660

Browse files
authored
fix: code typo (#152)
1 parent 64fd0f7 commit f9a0660

File tree

9 files changed

+12
-17
lines changed

9 files changed

+12
-17
lines changed

src/emd/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
CODEPIPELINE_ROLE_NAME_TEMPLATE = f"{ENV_STACK_NAME}-CodePipelineRole-{{region}}"
99
CLOUDFORMATION_ROLE_NAME_TEMPLATE = f"{ENV_STACK_NAME}-CloudFormationRole-{{region}}"
1010

11-
STACK_COMPLATE_STATUS_LIST = ['CREATE_COMPLETE','UPDATE_COMPLETE']
11+
STACK_COMPLETE_STATUS_LIST = ['CREATE_COMPLETE','UPDATE_COMPLETE']
1212
EMD_STACK_NOT_EXISTS_STATUS = 'NOT_EXISTS'
1313
EMD_STACK_OK_STATUS = 'OK'
1414
EMD_STACK_NOT_WORKING_STATUS = 'NOT_WORKING'
@@ -18,7 +18,7 @@
1818
EMD_MODELS_LOCAL_DIR_TEMPLATE = "emd_models/{model_id}"
1919
EMD_MODELS_S3_KEY_TEMPLATE = EMD_MODELS_LOCAL_DIR_TEMPLATE
2020

21-
EMD_DEFAULT_PROFILE_PARH = "~/.emd_default_profile"
21+
EMD_DEFAULT_PROFILE_PATH = "~/.emd_default_profile"
2222

2323
EMD_DEFAULT_CONTAINER_PREFIX = "emd"
2424

src/emd/models/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def get_image_push_account_id(self):
388388
return current_account_id
389389

390390
def get_image_uri(
391-
sef,
391+
self,
392392
account_id,
393393
region,
394394
image_name,

src/emd/utils/aws_service_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
EMD_STACK_OK_STATUS,
1515
ENV_STACK_NAME,
1616
MODEL_STACK_NAME_PREFIX,
17-
STACK_COMPLATE_STATUS_LIST,
17+
STACK_COMPLETE_STATUS_LIST,
1818
)
1919
from emd.models import Service, Model
2020
from emd.models.utils.constants import (

src/emd/utils/profile_manager.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
from emd.constants import EMD_DEFAULT_PROFILE_PARH
2+
from emd.constants import EMD_DEFAULT_PROFILE_PATH
33
import os
44
from emd.utils.logger_utils import get_logger
55

@@ -10,7 +10,7 @@
1010

1111

1212
class ProfileManager:
13-
def __init__(self,profile_path = EMD_DEFAULT_PROFILE_PARH):
13+
def __init__(self,profile_path = EMD_DEFAULT_PROFILE_PATH):
1414
self.profile_path = os.path.expanduser(profile_path)
1515

1616
def write_default_profile_name_to_local(self,aws_profile_name: str):
@@ -26,6 +26,7 @@ def load_profile_name_from_local(self):
2626

2727

2828
def set_default_aws_profile_from_local(self):
29+
profile_name = None
2930
try:
3031
profile_name = self.load_profile_name_from_local()
3132
except Exception as e:

src/pipeline/backend/huggingface/embedding/transformers_embedding_backend.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import torch
1010
from emd.constants import EMD_MODELS_LOCAL_DIR_TEMPLATE
1111
from emd.utils.logger_utils import get_logger
12-
import torch
1312
from threading import Thread
1413
import json
1514
from transformers import AutoModel
@@ -47,7 +46,7 @@ def start(self):
4746
)
4847
model_abs_path = os.path.abspath(model_dir)
4948

50-
# TODO add model iint args from model's definition
49+
# TODO add model init args from model's definition
5150
torch_dtype = self.pretrained_model_init_kwargs.get("torch_dtype")
5251
if torch_dtype is not None:
5352
self.pretrained_model_init_kwargs['torch_dtype'] = {

src/pipeline/backend/huggingface/llm/transformer_llm_backend.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from emd.constants import EMD_MODELS_LOCAL_DIR_TEMPLATE
1111
from emd.utils.logger_utils import get_logger
1212
from transformers import AutoModelForCausalLM, AutoTokenizer
13-
import torch
1413
from transformers import TextIteratorStreamer
1514
from threading import Thread
1615
import json
@@ -50,7 +49,7 @@ def start(self):
5049
)
5150
model_abs_path = os.path.abspath(model_dir)
5251

53-
# TODO add model iint args from model's definition
52+
# TODO add model init args from model's definition
5453
self.model = AutoModelForCausalLM.from_pretrained(
5554
model_abs_path,
5655
torch_dtype="auto",

src/pipeline/backend/huggingface/rerank/transformers_rerank_backend.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import torch
1010
from emd.constants import EMD_MODELS_LOCAL_DIR_TEMPLATE
1111
from emd.utils.logger_utils import get_logger
12-
import torch
1312
from threading import Thread
1413
import json
1514
from transformers import AutoModelForSequenceClassification
@@ -47,7 +46,7 @@ def start(self):
4746
)
4847
model_abs_path = os.path.abspath(model_dir)
4948

50-
# TODO add model iint args from model's definition
49+
# TODO add model init args from model's definition
5150
torch_dtype = self.pretrained_model_init_kwargs.get("torch_dtype")
5251
if torch_dtype is not None:
5352
self.pretrained_model_init_kwargs['torch_dtype'] = {

src/pipeline/framework/fast_api/fast_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def health():
7272
return "200 OK"
7373

7474
# As sagemaker endpoint requires...
75-
@app.post("/invocations")
75+
@app.post("/v1/invocations")
7676
@app.post("/v1/chat/completions")
7777
@app.post("/v1/embeddings")
7878
@app.post("/v1/rerank")

src/pipeline/utils/aws_service_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from .logger_utils import get_logger
66
import json
77
import hashlib
8-
import boto3
98
from emd.utils.aws_service_utils import get_current_region
109
logger = get_logger(__name__)
1110

@@ -39,7 +38,7 @@ def get_account_id():
3938
return account_id
4039

4140
def create_s3_bucket(bucket_name,region):
42-
s3 = boto3.client('s3')
41+
s3 = boto3.client('s3', region_name=region)
4342
try:
4443
s3.head_bucket(Bucket=bucket_name)
4544
except:
@@ -58,8 +57,6 @@ def create_s3_bucket(bucket_name,region):
5857
)
5958
except (s3.exceptions.BucketAlreadyOwnedByYou,):
6059
logger.info(f"bucket: {bucket_name} exists")
61-
except Exception as e:
62-
raise
6360

6461

6562
def get_role_create_template(

0 commit comments

Comments
 (0)