6
6
import com .github .tadayosi .torchserve .client .Management ;
7
7
import com .github .tadayosi .torchserve .client .management .api .DefaultApi ;
8
8
import com .github .tadayosi .torchserve .client .management .invoker .ApiClient ;
9
+ import com .github .tadayosi .torchserve .client .management .model .DescribeModel200ResponseInner ;
9
10
import com .github .tadayosi .torchserve .client .model .Api ;
10
11
import com .github .tadayosi .torchserve .client .model .ApiException ;
11
12
import com .github .tadayosi .torchserve .client .model .ModelDetail ;
@@ -91,7 +92,8 @@ public Response setAutoScale(String modelName, String modelVersion, SetAutoScale
91
92
@ Override
92
93
public List <ModelDetail > describeModel (String modelName ) throws ApiException {
93
94
try {
94
- return ModelDetail .fromList (api .describeModel (modelName ));
95
+ List <DescribeModel200ResponseInner > response = api .describeModel (modelName );
96
+ return response .stream ().map (ModelDetail ::from ).toList ();
95
97
} catch (com .github .tadayosi .torchserve .client .management .invoker .ApiException e ) {
96
98
throw new ApiException (e );
97
99
}
@@ -100,7 +102,8 @@ public List<ModelDetail> describeModel(String modelName) throws ApiException {
100
102
@ Override
101
103
public List <ModelDetail > describeModel (String modelName , String modelVersion ) throws ApiException {
102
104
try {
103
- return ModelDetail .fromList (api .versionDescribeModel (modelName , modelVersion ));
105
+ List <DescribeModel200ResponseInner > response = api .versionDescribeModel (modelName , modelVersion );
106
+ return response .stream ().map (ModelDetail ::from ).toList ();
104
107
} catch (com .github .tadayosi .torchserve .client .management .invoker .ApiException e ) {
105
108
throw new ApiException (e );
106
109
}
0 commit comments