-
Notifications
You must be signed in to change notification settings - Fork 392
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
45 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -729,6 +729,7 @@ | |
} | ||
] | ||
}, | ||
"python-api", | ||
"rest-api" | ||
] | ||
}, | ||
|
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,35 @@ | ||
# Python API | ||
|
||
The purpose of Studio Python API is to give programmatic access to information | ||
in Studio and executing actions in it. | ||
|
||
We provide Studio Python API as a part of DVC python package. To use it, you | ||
need to [install](/doc/install) DVC with `pip` or `conda`. | ||
|
||
This reference provides the details about the functions in the `dvc.studio` | ||
module, which can be loaded in any regular way, for example: | ||
|
||
```py | ||
import dvc.studio | ||
``` | ||
|
||
To use this API, you need to | ||
[generate](/doc/studio/user-guide/account-management#studio-access-token) and | ||
[set up](/doc/studio/user-guide/projects-and-experiments/live-metrics-and-plots#set-up-an-access-token) | ||
Studio access token. | ||
|
||
## Download model | ||
|
||
Download model binaries for a model from Model Registry. Requires the model to | ||
be stored with DVC with s3 or azure remote. Note, that you need to | ||
[set up remote cloud credentials](/doc/studio/user-guide/account-management#cloud-credentials) | ||
for Studio first. | ||
|
||
```py | ||
from dvc.studio.model_registry import download_model | ||
path = download_model( | ||
repo="iterative/demo-bank-customer-churn", | ||
model="randomforest-model", | ||
version="v2.0.0" | ||
) | ||
``` |
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,18 +1,20 @@ | ||
# REST API | ||
|
||
Studio REST API is WIP and will be extended. The API is hosted under the `/api` | ||
route on the Studio server: https://studio.iterative.ai/api or | ||
https://your-domain/api in case of | ||
The purpose of Studio REST API is to give programmatic access to information in | ||
Studio and executing actions in it. | ||
|
||
The API is hosted under the `/api` route on the Studio server: | ||
https://studio.iterative.ai/api or https://your-domain/api in case of | ||
[self-hosted Studio](/doc/studio/self-hosting/installation). | ||
|
||
To use API, you need to generate | ||
[Studio access token](/doc/studio/user-guide/account-management#studio-access-token). | ||
|
||
## Download model | ||
|
||
Get signed url to download the model binary. Requires the model to be stored | ||
with DVC with s3 or azure remote. `path` in model annotation must point to a | ||
single file and not to a directory. Note, that you need to | ||
Get signed url to download the model binaries for a model from Model Registry. | ||
Requires the model to be stored with DVC with s3 or azure remote. Note, that you | ||
need to | ||
[set up remote cloud credentials](/doc/studio/user-guide/account-management#cloud-credentials) | ||
for Studio have rights to sign urls. | ||
|
||
|
@@ -49,7 +51,7 @@ actually download the model. | |
### Example curl | ||
``` | ||
```sh | ||
$ curl https://studio.iterative.ai/api/model-registry/[email protected]:iterative/demo-bank-customer-churn.git&name=randomforest-model&version=v2.0.0 --header "Authorization:token <TOKEN>" | ||
|
||
{ | ||
|