Skip to content

Commit b7ed253

Browse files
Support handler changes
1 parent c2093e5 commit b7ed253

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

ads/aqua/extension/model_handler.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/env python
2-
# Copyright (c) 2024 Oracle and/or its affiliates.
2+
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
33
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
44

55
from typing import Optional
@@ -128,6 +128,10 @@ def post(self, *args, **kwargs): # noqa: ARG002
128128
download_from_hf = (
129129
str(input_data.get("download_from_hf", "false")).lower() == "true"
130130
)
131+
local_dir = input_data.get("local_dir")
132+
delete_from_local = (
133+
str(input_data.get("delete_from_local", "true")).lower() == "true"
134+
)
131135
inference_container_uri = input_data.get("inference_container_uri")
132136
allow_patterns = input_data.get("allow_patterns")
133137
ignore_patterns = input_data.get("ignore_patterns")
@@ -139,6 +143,8 @@ def post(self, *args, **kwargs): # noqa: ARG002
139143
model=model,
140144
os_path=os_path,
141145
download_from_hf=download_from_hf,
146+
local_dir=local_dir,
147+
delete_from_local=delete_from_local,
142148
inference_container=inference_container,
143149
finetuning_container=finetuning_container,
144150
compartment_id=compartment_id,

tests/unitary/with_extras/aqua/test_model_handler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*--
3-
# Copyright (c) 2024 Oracle and/or its affiliates.
3+
# Copyright (c) 2024, 2025 Oracle and/or its affiliates.
44
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
55

66
from unittest import TestCase
@@ -213,6 +213,8 @@ def test_register(
213213
project_id=None,
214214
model_file=model_file,
215215
download_from_hf=download_from_hf,
216+
local_dir=None,
217+
delete_from_local=True,
216218
inference_container_uri=inference_container_uri,
217219
allow_patterns=allow_patterns,
218220
ignore_patterns=ignore_patterns,

0 commit comments

Comments
 (0)