Skip to content

Commit 8d90b13

Browse files
committed
Addressing review comments
1 parent 9df166e commit 8d90b13

File tree

3 files changed

+38
-11
lines changed

3 files changed

+38
-11
lines changed

ads/aqua/common/utils.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from typing import List, Union
1818

1919
import fsspec
20-
import ocifs
2120
from cachetools import TTLCache, cached
2221

2322
import oci
@@ -55,6 +54,7 @@
5554
from ads.config import AQUA_SERVICE_MODELS_BUCKET, CONDA_BUCKET_NS, TENANCY_OCID
5655
from ads.model import DataScienceModel, ModelVersionSet
5756
from oci.data_science.models import JobRun, Model
57+
from oci.object_storage.models import ObjectSummary
5858

5959
logger = logging.getLogger("ads.aqua")
6060

@@ -243,15 +243,20 @@ def list_os_files_with_extension(oss_path: str, extension: str) -> [str]:
243243
- A list of file paths matching the specified extension.
244244
"""
245245

246+
oss_client = ObjectStorageDetails.from_path(oss_path)
246247
signer = default_signer()
247248

248249
# Ensure the extension is prefixed with a dot if not already
250+
249251
if not extension.startswith("."):
250252
extension = "." + extension
251-
fs = ocifs.OCIFileSystem(**signer)
252-
files: [str] = fs.ls(oss_path)
253+
files: List[ObjectSummary] = oss_client.list_objects().objects
253254

254-
return [file for file in files if file.endswith(extension)]
255+
return [
256+
file.name
257+
for file in files
258+
if file.name.endswith(extension) and "/" not in file.name
259+
]
255260

256261

257262
def is_valid_ocid(ocid: str) -> bool:
Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,36 @@
11
{
2+
"configuration": {
3+
"VM.Standard.A1.Flex": {
4+
"parameters": {},
5+
"shape_info": {
6+
"configs": [
7+
{
8+
"memory_in_gbs": 128,
9+
"ocpu": 32
10+
},
11+
{
12+
"memory_in_gbs": 256,
13+
"ocpu": 64
14+
},
15+
{
16+
"memory_in_gbs": 512,
17+
"ocpu": 128
18+
},
19+
{
20+
"memory_in_gbs": 1024,
21+
"ocpu": 256
22+
}
23+
],
24+
"type": "CPU"
25+
}
26+
}
27+
},
228
"shape": [
329
"VM.GPU.A10.1",
430
"VM.GPU.A10.2",
531
"BM.GPU.A10.4",
632
"BM.GPU4.8",
7-
"BM.GPU.A100-v2.8"
33+
"BM.GPU.A100-v2.8",
34+
"VM.Standard.A1.Flex"
835
]
936
}

ads/aqua/model/model.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -742,12 +742,7 @@ def get_model_files(os_path: str, model_format: ModelFormat) -> [str]:
742742

743743
if model_format == ModelFormat.GGUF:
744744
model_files.extend(
745-
[
746-
os.path.basename(path)
747-
for path in list_os_files_with_extension(
748-
oss_path=os_path, extension=".gguf"
749-
)
750-
]
745+
list_os_files_with_extension(oss_path=os_path, extension=".gguf")
751746
)
752747
return model_files
753748

0 commit comments

Comments
 (0)