Skip to content

Commit

Permalink
Reading from score file
Browse files Browse the repository at this point in the history
  • Loading branch information
TosinSeg committed Jun 28, 2023
1 parent c21c31b commit f525329
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mii/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,6 @@ class Deployment(BaseModel):
enable_deepspeed: bool = True
enable_zero: bool = True
GPU_index_map: dict = None
mii_config: dict = None
mii_config: MIIConfig = None
ds_config: dict = None
version: int = 1
4 changes: 2 additions & 2 deletions mii/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ def deploy(task=None,
If deployment_type is `LOCAL`, returns just the name of the deployment that can be used to create a query handle using `mii.mii_query_handle(deployment_name)`
"""
if len(deployments == 0):
assert model is not None and task is not None and deployment_name is not None, "model, task, and deployment name must be set to deploy sigular model"
if not deployments:
assert all((model, task, deployment_name)), "model, task, and deployment name must be set to deploy singular model"
deployments = [Deployment(deployment_name, task, model, enable_deepspeed, enable_zero, None, mii_config, ds_config, version)]
deployment_tag = deployment_name + "_tag"
else:
Expand Down
4 changes: 3 additions & 1 deletion mii/models/score/score_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@
def init():
model_path = mii.utils.full_model_path(configs[mii.constants.MODEL_PATH_KEY])
deployment_tag = configs[mii.constants.DEPLOYMENT_TAG_KEY]
deployments = mii.multi_model_deployments[deployment_tag]
deployments = []
for deployment in configs.values():
deployments.append(Deployment(deployment[mii.constants.DEPLOYMENT_NAME_KEY], deployment[mii.constants.TASK_NAME_KEY], deployment[mii.constants.DEPLOYMENT_MODEL_NAME_KEY], deloyment[mii.constants.ENABLE_DEEPSPEED_KEY], deployment[mii.constants.ENABLE_DEEPSPEED_ZERO_KEY], None, deployment[mii.constants.MII_CONFIGS_KEY], deployment[mii.constants.DS_CONFIG_KEY], 1))

deployment_name = configs[mii.constants.DEPLOYMENT_NAME_KEY]
model_name = configs[mii.constants.MODEL_NAME_KEY]
Expand Down

0 comments on commit f525329

Please sign in to comment.