Skip to content
Get started

Replace Pairs

models.training_images.replace_pairs(strmodel_id, TrainingImageReplacePairsParams**kwargs) -> TrainingImageReplacePairsResponse
PUT/models/{modelId}/training-images/pairs

Replace all training image pairs for the given modelId

ParametersExpand Collapse
model_id: str
body: Iterable[Body]

Array of training image pairs

instruction: Optional[str]

The instruction for the image pair, source to target

source_id: Optional[str]

The source asset ID (must be a training asset)

target_id: Optional[str]

The target asset ID (must be a training asset)

ReturnsExpand Collapse
class TrainingImageReplacePairsResponse:
count: float

Number of training image pairs

pairs: List[Pair]

Array of training image pairs

instruction: Optional[str]

The instruction for the image pair, source to target

source_id: Optional[str]

The source asset ID (must be a training asset)

target_id: Optional[str]

The target asset ID (must be a training asset)

Replace Pairs

import os
from scenario_sdk import Scenario

client = Scenario(
    api_key=os.environ.get("SCENARIO_SDK_API_KEY"),  # This is the default and can be omitted
    api_secret=os.environ.get("SCENARIO_SDK_API_SECRET"),  # This is the default and can be omitted
)
response = client.models.training_images.replace_pairs(
    model_id="modelId",
    body=[{}],
)
print(response.count)
{
  "count": 0,
  "pairs": [
    {
      "instruction": "instruction",
      "sourceId": "sourceId",
      "targetId": "targetId"
    }
  ]
}
Returns Examples
{
  "count": 0,
  "pairs": [
    {
      "instruction": "instruction",
      "sourceId": "sourceId",
      "targetId": "targetId"
    }
  ]
}