Skip to content

Commit 7f3cc7f

Browse files
committed
Updated python docs
1 parent 4cc8823 commit 7f3cc7f

File tree

1 file changed

+29
-8
lines changed

1 file changed

+29
-8
lines changed

ads/model/datascience_model.py

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,22 +1481,33 @@ def add_artifact(
14811481
14821482
Parameters
14831483
----------
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.
14871494
14881495
Returns
14891496
-------
14901497
None
14911498
14921499
Raises
14931500
------
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.
14951506
14961507
Note
14971508
----
14981509
- 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.
15001511
- If no objects are found to add to the model description, a ValueError is raised.
15011512
"""
15021513

@@ -1609,19 +1620,29 @@ def remove_artifact(
16091620
prefix: Optional[str] = None
16101621
):
16111622
"""
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.
16131624
16141625
Parameters
16151626
----------
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.
16171635
16181636
Returns
16191637
-------
16201638
None
16211639
16221640
Raises
16231641
------
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.
1645+
- If the model description JSON is None.
16251646
"""
16261647

16271648
if uri and (namespace or bucket):

0 commit comments

Comments
 (0)