logger
WithLogger
¶
Bases: ModelManagerDecorator
Logger Decorator, it logs what's going on inside the manager.
Source code in inference/core/managers/decorators/logger.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
|
add_model(model_id, api_key, model_id_alias=None)
¶
Adds a model to the manager and logs the action.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
str
|
The identifier of the model. |
required |
model
|
Model
|
The model instance. |
required |
Returns:
Type | Description |
---|---|
The result of the add_model method from the superclass. |
Source code in inference/core/managers/decorators/logger.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
infer_from_request(model_id, request, **kwargs)
async
¶
Processes a complete inference request and logs both the request and response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
str
|
The identifier of the model. |
required |
request
|
InferenceRequest
|
The request to process. |
required |
Returns:
Name | Type | Description |
---|---|---|
InferenceResponse |
InferenceResponse
|
The response from the inference. |
Source code in inference/core/managers/decorators/logger.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
infer_from_request_sync(model_id, request, **kwargs)
¶
Processes a complete inference request and logs both the request and response.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
str
|
The identifier of the model. |
required |
request
|
InferenceRequest
|
The request to process. |
required |
Returns:
Name | Type | Description |
---|---|---|
InferenceResponse |
InferenceResponse
|
The response from the inference. |
Source code in inference/core/managers/decorators/logger.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
remove(model_id)
¶
Removes a model from the manager and logs the action.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
model_id
|
str
|
The identifier of the model to remove. |
required |
Returns:
Name | Type | Description |
---|---|---|
Model |
Model
|
The removed model. |
Source code in inference/core/managers/decorators/logger.py
62 63 64 65 66 67 68 69 70 71 72 73 |
|