-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* port from #2497 * Auto-update of Starter template * Auto-update of E2E template * Auto-update of NLP template * lint * fix LLM template * Auto-update of LLM Finetuning template * Auto-update of LLM Finetuning template * Update src/zenml/zen_server/routers/logs_endpoints.py Co-authored-by: Barış Can Durak <[email protected]> * Refactor logs endpoint authorization logic * Refactor logs endpoint definition * Refactor resource limit settings in test_vertex_orchestrator.py --------- Co-authored-by: GitHub Actions <[email protected]> Co-authored-by: Barış Can Durak <[email protected]>
- Loading branch information
1 parent
5dfac96
commit b5fa790
Showing
9 changed files
with
92 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
zenml | ||
torch>=2.2.0 | ||
datasets | ||
datasets>=2.15 | ||
transformers | ||
peft | ||
bitsandbytes>=0.41.3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright (c) ZenML GmbH 2024. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at: | ||
# | ||
# https://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
# or implied. See the License for the specific language governing | ||
# permissions and limitations under the License. | ||
"""Endpoint definitions for logs.""" | ||
|
||
from uuid import UUID | ||
|
||
from fastapi import APIRouter, Security | ||
|
||
from zenml.constants import ( | ||
API, | ||
LOGS, | ||
VERSION_1, | ||
) | ||
from zenml.models.v2.core.logs import LogsResponse | ||
from zenml.zen_server.auth import AuthContext, authorize | ||
from zenml.zen_server.exceptions import error_response | ||
from zenml.zen_server.rbac.endpoint_utils import ( | ||
verify_permissions_and_get_entity, | ||
) | ||
from zenml.zen_server.utils import ( | ||
handle_exceptions, | ||
zen_store, | ||
) | ||
|
||
router = APIRouter( | ||
prefix=API + VERSION_1 + LOGS, | ||
tags=["logs"], | ||
responses={401: error_response, 403: error_response}, | ||
) | ||
|
||
|
||
@router.get( | ||
"/{logs_id}", | ||
response_model=LogsResponse, | ||
responses={401: error_response, 404: error_response, 422: error_response}, | ||
) | ||
@handle_exceptions | ||
def get_logs( | ||
logs_id: UUID, | ||
hydrate: bool = True, | ||
_: AuthContext = Security(authorize), | ||
) -> LogsResponse: | ||
"""Returns the requested logs. | ||
Args: | ||
logs_id: ID of the logs. | ||
hydrate: Flag deciding whether to hydrate the output model(s) | ||
by including metadata fields in the response. | ||
Returns: | ||
The requested logs. | ||
""" | ||
return verify_permissions_and_get_entity( | ||
id=logs_id, get_method=zen_store().get_logs, hydrate=hydrate | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters