CustomModel |
## Example Usage
<!--Start PulumiCodeChooser -->
```java
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.bedrockfoundation.BedrockfoundationFunctions;
import com.pulumi.aws.bedrockfoundation.inputs.GetModelArgs;
import com.pulumi.aws.bedrock.CustomModel;
import com.pulumi.aws.bedrock.CustomModelArgs;
import com.pulumi.aws.bedrock.inputs.CustomModelOutputDataConfigArgs;
import com.pulumi.aws.bedrock.inputs.CustomModelTrainingDataConfigArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var example = BedrockfoundationFunctions.getModel(GetModelArgs.builder()
.modelId("amazon.titan-text-express-v1")
.build());
var exampleCustomModel = new CustomModel("exampleCustomModel", CustomModelArgs.builder()
.customModelName("example-model")
.jobName("example-job-1")
.baseModelIdentifier(example.applyValue(getModelResult -> getModelResult.modelArn()))
.roleArn(exampleAwsIamRole.arn())
.hyperparameters(Map.ofEntries(
Map.entry("epochCount", "1"),
Map.entry("batchSize", "1"),
Map.entry("learningRate", "0.005"),
Map.entry("learningRateWarmupSteps", "0")
))
.outputDataConfig(CustomModelOutputDataConfigArgs.builder()
.s3Uri(String.format("s3://%s/data/", output.id()))
.build())
.trainingDataConfig(CustomModelTrainingDataConfigArgs.builder()
.s3Uri(String.format("s3://%s/data/train.jsonl", training.id()))
.build())
.build());
}
}
```
<!--End PulumiCodeChooser -->
## Import
Using `pulumi import`, import Bedrock custom model using the `job_arn`.
|