|
10 | 10 |
|
11 | 11 | from ads.aqua.config.utils.serializer import Serializable
|
12 | 12 |
|
13 |
| -# Constants |
14 |
| -INFERENCE_RPS = 25 # Max RPS for inferencing deployed model. |
15 |
| -INFERENCE_TIMEOUT = 120 |
16 |
| -INFERENCE_MAX_THREADS = 10 # Maximum parallel threads for model inference. |
17 |
| -INFERENCE_RETRIES = 3 |
18 |
| -INFERENCE_BACKOFF_FACTOR = 3 |
19 |
| -INFERENCE_DELAY = 0 |
20 |
| - |
21 | 13 |
|
22 | 14 | class ModelParamsOverrides(Serializable):
|
23 | 15 | """Defines overrides for model parameters, including exclusions and additional inclusions."""
|
@@ -54,13 +46,6 @@ class Config:
|
54 | 46 | class InferenceParams(Serializable):
|
55 | 47 | """Contains inference-related parameters with defaults."""
|
56 | 48 |
|
57 |
| - inference_rps: Optional[int] = INFERENCE_RPS |
58 |
| - inference_timeout: Optional[int] = INFERENCE_TIMEOUT |
59 |
| - inference_max_threads: Optional[int] = INFERENCE_MAX_THREADS |
60 |
| - inference_retries: Optional[int] = INFERENCE_RETRIES |
61 |
| - inference_backoff_factor: Optional[float] = INFERENCE_BACKOFF_FACTOR |
62 |
| - inference_delay: Optional[float] = INFERENCE_DELAY |
63 |
| - |
64 | 49 | class Config:
|
65 | 50 | extra = "allow"
|
66 | 51 |
|
@@ -224,20 +209,18 @@ def search_shapes(
|
224 | 209 | -------
|
225 | 210 | List[ShapeConfig]: A list of shapes that match the filters.
|
226 | 211 | """
|
227 |
| - results = [] |
228 |
| - for shape in self.shapes: |
229 |
| - if ( |
230 |
| - evaluation_container |
231 |
| - and evaluation_container not in shape.filter.evaluation_container |
232 |
| - ): |
233 |
| - continue |
| 212 | + return [ |
| 213 | + shape |
| 214 | + for shape in self.shapes |
234 | 215 | if (
|
235 |
| - evaluation_target |
236 |
| - and evaluation_target not in shape.filter.evaluation_target |
237 |
| - ): |
238 |
| - continue |
239 |
| - results.append(shape) |
240 |
| - return results |
| 216 | + not evaluation_container |
| 217 | + or evaluation_container in shape.filter.evaluation_container |
| 218 | + ) |
| 219 | + and ( |
| 220 | + not evaluation_target |
| 221 | + or evaluation_target in shape.filter.evaluation_target |
| 222 | + ) |
| 223 | + ] |
241 | 224 |
|
242 | 225 | class Config:
|
243 | 226 | extra = "ignore"
|
|
0 commit comments