Skip to content

chore(specs): setup revised predict model spec #1045

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
merged 2 commits into from
Sep 30, 2022
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
22 changes: 9 additions & 13 deletions specs/predict/common/schemas/modelsParams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ activateModelParams:
$ref: '#/sourceID'
index:
$ref: '#/index'
affinities:
modelAttributes:
type: array
items:
$ref: '#/affinities'
$ref: '#/modelAttributes'
contentAttributes:
type: array
items:
Expand All @@ -28,20 +28,16 @@ updateModelParams:
properties:
name:
$ref: '#/name'
affinities:
modelAttributes:
type: array
items:
$ref: '#/affinities'
$ref: '#/modelAttributes'
contentAttributes:
type: array
items:
$ref: '#/contentAttributes'
status:
$ref: '#/status'
required:
- modelID
- sourceID
- index
modelStatus:
$ref: '#/modelStatus'

type:
type: string
Expand All @@ -60,15 +56,15 @@ index:
type: string
description: The index name.

affinities:
modelAttributes:
type: string
description: List of items attributes that will be used as affinities. This param is required if `type=affinities`.
description: List of items attributes that will be used in the model. This param is required if the model `type` needs it (e.g. `affinities`, `funnel_stage`).

contentAttributes:
type: string
description: List of items attributes that will be used for embeddings, for ex. titles or descriptions.

status:
modelStatus:
type: string
enum: [active, inactive]
description: |
Expand Down
2 changes: 1 addition & 1 deletion specs/predict/paths/models/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ post:
summary: Activate a model instance.
description: >
Activate an existing model template. This action triggers the training and inference pipelines for the selected model.
The model is added with `status=pending`.
The model is added with `modelStatus=pending`.
If a model with the exact same source & index already exists, the API endpoint returns an error.
requestBody:
required: true
Expand Down
24 changes: 17 additions & 7 deletions specs/predict/responses/Models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ modelInstance:
type: string
index:
type: string
affinities:
type: array
items:
type: string
description: Affinities within this model instance.
modelAttributes:
$ref: '#/modelAttributes'
contentAttributes:
type: array
items:
Expand All @@ -41,11 +38,11 @@ modelInstance:
- type
- sourceID
- index
- affinities
- modelAttributes
- contentAttributes
- lastTrained
- lastInference
- status
- modelStatus

getModelInstanceConfigStatus:
type: string
Expand Down Expand Up @@ -77,3 +74,16 @@ modelMetrics:
format: double
updatedAt:
$ref: '../../common/responses/common.yml#/updatedAt'

modelAttributes:
type: object
additionalProperties: false
properties:
name:
type: string
values:
type: array
items:
type: string
required:
- name
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"name": "Shopping stage for EU users",
"sourceID": "0200030-129930",
"index": "Products Production",
"affinities": [],
"modelAttributes": [],
"contentAttributes": [
"title",
"description"
Expand All @@ -20,7 +20,7 @@
"name": "Shopping stage for EU users",
"sourceID": "0200030-129930",
"index": "Products Production",
"affinities": [],
"modelAttributes": [],
"contentAttributes": [
"title",
"description"
Expand Down
8 changes: 4 additions & 4 deletions tests/CTS/methods/requests/predict/updateModelInstance.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"modelID": "model1",
"updateModelParams": {
"name": "Shopping stage for EU users",
"affinities": [
"modelAttributes": [
"brand",
"color",
"category_level0",
Expand All @@ -15,15 +15,15 @@
"title",
"description"
],
"status": "inactive"
"modelStatus": "inactive"
}
},
"request": {
"path": "/1/predict/models/model1",
"method": "POST",
"body": {
"name": "Shopping stage for EU users",
"affinities": [
"modelAttributes": [
"brand",
"color",
"category_level0",
Expand All @@ -33,7 +33,7 @@
"title",
"description"
],
"status": "inactive"
"modelStatus": "inactive"
}
}
}
Expand Down