Skip to content

RSDK-7970: finish adding submitcustomtrainingjob #686

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/viam/app/ml_training_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ async def submit_training_job(
return response.id

async def submit_custom_training_job(
self, org_id: str, dataset_id: str, registry_item_id: str, model_name: str, model_version: str
self, org_id: str, dataset_id: str, registry_item_id: str, registry_item_version: str, model_name: str, model_version: str
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding an arg in the middle here means this becomes a breaking change. Which is fine, but everyone will need to be notified

) -> str:
"""Submit a custom training job.

Expand All @@ -129,14 +129,16 @@ async def submit_custom_training_job(
organization_id=organization_id,
dataset_id=dataset_id,
registry_item_id="your-registry-item-id",
registry_item_version="your-registry-item-version",
model_name="your-model-name",
model_version="1"
)

Args:
org_id (str): the id of the org to submit the training job to
dataset_id (str): the id of the dataset
registry_item_id (List[str]): the id of the registry item
registry_item_id (str): the id of the registry item
registry_item_version (str): the version of the registry item
model_name (str): the model name
model_version (str): the model version

Expand All @@ -149,6 +151,7 @@ async def submit_custom_training_job(
request = SubmitCustomTrainingJobRequest(
dataset_id=dataset_id,
registry_item_id=registry_item_id,
registry_item_version=registry_item_version,
organization_id=org_id,
model_name=model_name,
model_version=model_version,
Expand Down
8 changes: 7 additions & 1 deletion tests/test_ml_training_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
ORG_ID = "org-id"
DATASET_ID = "dataset-id"
REGISTRY_ITEM_ID = "registry-item-id"
REGISTRY_ITEM_VERSION = "registry-item-version"
MODEL_ID = "model-id"
MODEL_NAME = "model-name"
MODEL_VERSION = "model-version"
Expand Down Expand Up @@ -80,7 +81,12 @@ async def test_custom_submit_training_job(self, service: MockMLTraining):
async with ChannelFor([service]) as channel:
client = MLTrainingClient(channel, ML_TRAINING_SERVICE_METADATA)
id = await client.submit_custom_training_job(
org_id=ORG_ID, dataset_id=DATASET_ID, registry_item_id=REGISTRY_ITEM_ID, model_name=MODEL_NAME, model_version=MODEL_VERSION
org_id=ORG_ID,
dataset_id=DATASET_ID,
registry_item_id=REGISTRY_ITEM_ID,
registry_item_version=REGISTRY_ITEM_VERSION,
model_name=MODEL_NAME,
model_version=MODEL_VERSION,
)
assert id == JOB_ID

Expand Down
Loading