You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ads/model/datascience_model.py
+29-8Lines changed: 29 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1481,22 +1481,33 @@ def add_artifact(
1481
1481
1482
1482
Parameters
1483
1483
----------
1484
-
uri (str): The URI representing the location of the artifact in OCI object storage.
1485
-
files (list of str, optional): A list of file names to include in the model description.
1486
-
If provided, only objects with matching file names will be included. Defaults to None.
1484
+
uri : str, optional
1485
+
The URI representing the location of the artifact in OCI object storage.
1486
+
namespace : str, optional
1487
+
The namespace of the bucket containing the objects. Required if `uri` is not provided.
1488
+
bucket : str, optional
1489
+
The name of the bucket containing the objects. Required if `uri` is not provided.
1490
+
prefix : str, optional
1491
+
The prefix of the objects to add. Defaults to None. Cannot be provided if `files` is provided.
1492
+
files : list of str, optional
1493
+
A list of file names to include in the model description. If provided, only objects with matching file names will be included. Cannot be provided if `prefix` is provided.
1487
1494
1488
1495
Returns
1489
1496
-------
1490
1497
None
1491
1498
1492
1499
Raises
1493
1500
------
1494
-
ValueError: If no files are found to add to the model description.
1501
+
ValueError
1502
+
- If both `uri` and (`namespace` and `bucket`) are provided.
1503
+
- If neither `uri` nor both `namespace` and `bucket` are provided.
1504
+
- If both `prefix` and `files` are provided.
1505
+
- If no files are found to add to the model description.
1495
1506
1496
1507
Note
1497
1508
----
1498
1509
- If `files` is not provided, it retrieves information about all objects in the bucket.
1499
-
If `files` is provided, it only retrieves information about objects with matching file names.
1510
+
- If `files` is provided, it only retrieves information about objects with matching file names.
1500
1511
- If no objects are found to add to the model description, a ValueError is raised.
1501
1512
"""
1502
1513
@@ -1609,19 +1620,29 @@ def remove_artifact(
1609
1620
prefix: Optional[str] =None
1610
1621
):
1611
1622
"""
1612
-
Removes information about objects in a specified bucket from the model description JSON.
1623
+
Removes information about objects in a specified bucket or using a specified URI from the model description JSON.
1613
1624
1614
1625
Parameters
1615
1626
----------
1616
-
uri (str): The URI representing the location of the artifact in OCI object storage.
1627
+
uri : str, optional
1628
+
The URI representing the location of the artifact in OCI object storage.
1629
+
namespace : str, optional
1630
+
The namespace of the bucket containing the objects. Required if `uri` is not provided.
1631
+
bucket : str, optional
1632
+
The name of the bucket containing the objects. Required if `uri` is not provided.
1633
+
prefix : str, optional
1634
+
The prefix of the objects to remove. Defaults to None.
1617
1635
1618
1636
Returns
1619
1637
-------
1620
1638
None
1621
1639
1622
1640
Raises
1623
1641
------
1624
-
ValueError: If the model description JSON is None.
1642
+
ValueError
1643
+
- If both 'uri' and ('namespace' and 'bucket') are provided.
1644
+
- If neither 'uri' nor both 'namespace' and 'bucket' are provided.
0 commit comments