Skip to content

Commit c943c5e

Browse files
committed
testing adding default
1 parent 41e1d65 commit c943c5e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

frontend/archive/src/main/java/org/pytorch/serve/archive/model/ModelConfig.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,12 @@ public static ModelConfig build(Map<String, Object> yamlMap) {
127127
case "startupTimeout":
128128
if (v instanceof Integer) {
129129
modelConfig.setStartupTimeout((int) v);
130-
} else {
130+
} else if {
131131
logger.warn("Invalid startupTimeout: {}, should be integer", v);
132132
}
133+
else {
134+
modelConfig.setStartupTimeout(startupTimeout);
135+
}
133136
break;
134137
case "deviceType":
135138
if (v instanceof String) {

frontend/server/src/main/java/org/pytorch/serve/snapshot/SnapshotManager.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,8 @@ public Snapshot getSnapshot(String snapshotName) throws SnapshotReadException {
112112
}
113113

114114
public void restore(String modelSnapshot) throws InvalidSnapshotException, IOException {
115-
String result = modelSnapshot.substring(0, modelSnapshot.length() - 1) + ",\n \"startupTimeout\": 120 }";
116-
logger.info("Started restoring models from snapshot {}", result);
117-
Snapshot snapshot = snapshotSerializer.getSnapshot(result);
115+
logger.info("Started restoring models from snapshot {}", modelSnapshot);
116+
Snapshot snapshot = snapshotSerializer.getSnapshot(modelSnapshot);
118117
// Validate snapshot
119118
validate(snapshot);
120119
// Init. models

0 commit comments

Comments
 (0)