Skip to content

Commit 91a0c82

Browse files
authored
More renaming of instance (#925)
1 parent 525845c commit 91a0c82

File tree

5 files changed

+56
-57
lines changed

5 files changed

+56
-57
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Kaggle API
1+
# Kaggle CLI
22

33
The official CLI to interact with [Kaggle](https://www.kaggle.com).
44

@@ -90,11 +90,9 @@ hatch run test:local
9090

9191
### Integration Tests
9292

93-
To run integration tests on your local machine, you need to set up your Kaggle API credentials. You can do this in one of these two ways described [this doc](docs/README.md). Refer to the sections:
94-
- Using environment variables
95-
- Using credentials file
93+
To run integration tests on your local machine, you need to set up your Kaggle credentials. You can do this by following the [authentication instructions](docs/README.md).
9694

97-
After setting up your credentials by any of these methods, you can run the integration tests as follows:
95+
After setting up your credentials, you can run the integration tests as follows:
9896

9997
```sh
10098
hatch run test:integration
@@ -110,6 +108,6 @@ See [CONTRIBUTING.md](./CONTRIBUTING.md).
110108

111109
## License
112110

113-
The Kaggle API is released under the [Apache 2.0 license](LICENSE.txt).
111+
The Kaggle CLI is released under the [Apache 2.0 license](LICENSE.txt).
114112

115113

docs/model_instances.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Commands for interacting with variations of Kaggle Models. A model variation typ
55
## `kaggle models variations init`
66

77
Initializes a metadata file (`model-instance-metadata.json`) for creating a new model variation.
8+
Note that the name of the file reflects the old name for a variation, which was "instance".
89

910
**Usage:**
1011

@@ -52,7 +53,7 @@ Create a new model variation using the metadata and files in the `tmp` folder, q
5253
# Example: Edit model-instance-metadata.json first
5354
# sed -i 's/INSERT_OWNER_SLUG_HERE/your-username/' tmp/model-instance-metadata.json
5455
# sed -i 's/INSERT_EXISTING_MODEL_SLUG_HERE/parent-model-slug/' tmp/model-instance-metadata.json
55-
# sed -i 's/INSERT_INSTANCE_SLUG_HERE/my-instance-slug/' tmp/model-instance-metadata.json
56+
# sed -i 's/INSERT_INSTANCE_SLUG_HERE/my-variation-slug/' tmp/model-instance-metadata.json
5657
# sed -i 's/INSERT_FRAMEWORK_HERE/jax/' tmp/model-instance-metadata.json
5758
# echo "a,b,c,d" > tmp/data.csv # Example model file
5859

@@ -70,12 +71,12 @@ Downloads the `model-instance-metadata.json` file for an existing model variatio
7071
**Usage:**
7172

7273
```bash
73-
kaggle models variations get <MODEL_INSTANCE> -p <FOLDER_PATH>
74+
kaggle models variations get <MODEL_VARIATION> -p <FOLDER_PATH>
7475
```
7576

7677
**Arguments:**
7778

78-
* `<MODEL_INSTANCE>`: Model variation URL suffix in the format `owner/model-slug/framework/instance-slug` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
79+
* `<MODEL_VARIATION>`: Model variation URL suffix in the format `owner/model-slug/framework/variation-slug` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
7980

8081
**Options:**
8182

@@ -100,12 +101,12 @@ Lists files for the current version of a model variation.
100101
**Usage:**
101102

102103
```bash
103-
kaggle models variations files <MODEL_INSTANCE> [options]
104+
kaggle models variations files <MODEL_VARIATION> [options]
104105
```
105106

106107
**Arguments:**
107108

108-
* `<MODEL_INSTANCE>`: Model variation URL suffix (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
109+
* `<MODEL_VARIATION>`: Model variation URL suffix (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
109110

110111
**Options:**
111112

@@ -158,12 +159,12 @@ Deletes a model variation from Kaggle.
158159
**Usage:**
159160

160161
```bash
161-
kaggle models variations delete <MODEL_INSTANCE> [options]
162+
kaggle models variations delete <MODEL_VARIATION> [options]
162163
```
163164

164165
**Arguments:**
165166

166-
* `<MODEL_INSTANCE>`: Model variation URL suffix in the format `owner/model-slug/framework/instance-slug` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
167+
* `<MODEL_VARIATION>`: Model variation URL suffix in the format `owner/model-slug/framework/variation-slug` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
167168

168169
**Options:**
169170

docs/model_instances_versions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ Creates a new version of an existing model variation.
99
**Usage:**
1010

1111
```bash
12-
kaggle models variations versions create <MODEL_INSTANCE> -p <FOLDER_PATH> [options]
12+
kaggle models variations versions create <MODEL_VARIATION> -p <FOLDER_PATH> [options]
1313
```
1414

1515
**Arguments:**
1616

17-
* `<MODEL_INSTANCE>`: The target model variation URL suffix for the new version (format: `owner/model-slug/framework/instance-slug`, e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
17+
* `<MODEL_VARIATION>`: The target model variation URL suffix for the new version (format: `owner/model-slug/framework/variation-slug`, e.g., `$KAGGLE_DEVELOPER/test-model/jax/main`).
1818

1919
**Options:**
2020

@@ -45,12 +45,12 @@ Downloads files for a specific version of a model variation.
4545
**Usage:**
4646

4747
```bash
48-
kaggle models variations versions download <MODEL_INSTANCE_VERSION> [options]
48+
kaggle models variations versions download <MODEL_VARIATION_VERSION> [options]
4949
```
5050

5151
**Arguments:**
5252

53-
* `<MODEL_INSTANCE_VERSION>`: Model variation version URL suffix in the format `owner/model-slug/framework/instance-slug/version-number` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main/1`).
53+
* `<MODEL_VARIATION_VERSION>`: Model variation version URL suffix in the format `owner/model-slug/framework/variation-slug/version-number` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main/1`).
5454

5555
**Options:**
5656

@@ -79,12 +79,12 @@ Lists files for a specific version of a model variation.
7979
**Usage:**
8080

8181
```bash
82-
kaggle models variations versions files <MODEL_INSTANCE_VERSION> [options]
82+
kaggle models variations versions files <MODEL_VARIATION_VERSION> [options]
8383
```
8484

8585
**Arguments:**
8686

87-
* `<MODEL_INSTANCE_VERSION>`: Model variation version URL suffix (e.g., `google/gemma/pytorch/7b/2`).
87+
* `<MODEL_VARIATION_VERSION>`: Model variation version URL suffix (e.g., `google/gemma/pytorch/7b/2`).
8888

8989
**Options:**
9090

@@ -111,12 +111,12 @@ Deletes a specific version of a model variation from Kaggle.
111111
**Usage:**
112112

113113
```bash
114-
kaggle models variations versions delete <MODEL_INSTANCE_VERSION> [options]
114+
kaggle models variations versions delete <MODEL_VARIATION_VERSION> [options]
115115
```
116116

117117
**Arguments:**
118118

119-
* `<MODEL_INSTANCE_VERSION>`: Model variation version URL suffix in the format `owner/model-slug/framework/instance-slug/version-number` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main/1`).
119+
* `<MODEL_VARIATION_VERSION>`: Model variation version URL suffix in the format `owner/model-slug/framework/variation-slug/version-number` (e.g., `$KAGGLE_DEVELOPER/test-model/jax/main/1`).
120120

121121
**Options:**
122122

docs/models_metadata.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
A full model is composed of 3 types of entities:
22

33
1. The model
4-
2. The instances
5-
3. The instance versions
4+
2. The variations
5+
3. The variation versions
66

77
Let's take the example of [efficientnet](https://www.kaggle.com/models/tensorflow/efficientnet) to explain these entities.
88

9-
A model like `efficientnet` contains multiple instances.
9+
A model like `efficientnet` contains multiple variations.
1010

11-
An instance is a specific variation of the model (e.g. B0, B1, ...) with a certain framework (e.g. TensorFlow2).
11+
A variation is a specific variation of the model (e.g. B0, B1, ...) with a certain framework (e.g. TensorFlow2).
1212

1313
## Model
1414

@@ -44,9 +44,9 @@ We currently support the following metadata fields for models.
4444
* `publishTime`: the original publishing time of the model
4545
* `provenanceSources`: the provenance of the model
4646

47-
## Model Instance
47+
## Model Variation
4848

49-
To create a model instance, a special `model-instance-metadata.json` file must be specified.
49+
To create a model variation, a special `model-instance-metadata.json` file must be specified.
5050

5151
Here's a basic example for `model-instance-metadata.json`:
5252
```
@@ -66,22 +66,22 @@ Here's a basic example for `model-instance-metadata.json`:
6666
}
6767
```
6868

69-
You can also use the API command `kaggle models instances init -p /path/to/model-instance` to have the API create this file for you for a new model instance.
69+
You can also use the API command `kaggle models variations init -p /path/to/model-variation` to have the API create this file for you for a new model variation.
7070

7171
### Contents
7272

73-
We currently support the following metadata fields for model instances.
73+
We currently support the following metadata fields for model variations.
7474

7575
* `ownerSlug`: the slug of the user or organization of the model
7676
* `modelSlug`: the existing model's slug
77-
* `instanceSlug`: the slug of the instance
78-
* `framework`: the instance's framework (possible options: `tensorFlow1`,`tensorFlow2`,`tfLite`,`tfJs`,`pyTorch`,`jax`,`coral`, ...)
79-
* `overview`: a short overview of the instance
80-
* `usage`: the instance's usage in markdown syntax (see the template below)
81-
* `fineTunable`: whether the instance is fine tunable
77+
* `instanceSlug`: the slug of the variation
78+
* `framework`: the variation's framework (possible options: `tensorFlow1`,`tensorFlow2`,`tfLite`,`tfJs`,`pyTorch`,`jax`,`coral`, ...)
79+
* `overview`: a short overview of the variation
80+
* `usage`: the variation's usage in markdown syntax (see the template below)
81+
* `fineTunable`: whether the variation is fine tunable
8282
* `trainingData`: a list of training data in the form of strings, URLs, Kaggle Datasets, etc...
83-
* `modelInstanceType`: whether the model instance is a base model, external variant, internal variant, or unspecified
84-
* `baseModelInstance`: if this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{instance-slug}` of the base model instance
83+
* `modelInstanceType`: whether the model variation is a base model, external variant, internal variant, or unspecified
84+
* `baseModelInstance`: if this is an internal variant, the `{owner-slug}/{model-slug}/{framework}/{variation-slug}` of the base model variation
8585
* `externalBaseModelUrl`: if this is an external variant, a URL to the base model
8686

8787
### Licenses

src/kaggle/cli.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def main() -> None:
3535
"-v",
3636
"--version",
3737
action="version",
38-
help="Print the Kaggle API version",
39-
version="Kaggle API " + kaggle.__version__,
38+
help="Print the Kaggle CLI version",
39+
version="Kaggle CLI " + kaggle.__version__,
4040
)
4141
parser.add_argument(
4242
"-W",
@@ -1087,9 +1087,9 @@ class Help(object):
10871087
+ ", ".join(kernels_choices)
10881088
+ "}\nmodels {"
10891089
+ ", ".join(models_choices)
1090-
+ "}\nmodels instances {"
1090+
+ "}\nmodels variations {"
10911091
+ ", ".join(model_instances_choices)
1092-
+ "}\nmodels instances versions {"
1092+
+ "}\nmodels variations versions {"
10931093
+ ", ".join(model_instance_versions_choices)
10941094
+ "}\nconfig {"
10951095
+ ", ".join(config_choices)
@@ -1102,8 +1102,8 @@ class Help(object):
11021102
group_datasets = "Commands related to Kaggle datasets"
11031103
group_kernels = "Commands related to Kaggle kernels"
11041104
group_models = "Commands related to Kaggle models"
1105-
group_model_instances = "Commands related to Kaggle model instances"
1106-
group_model_instance_versions = "Commands related to Kaggle model instance versions"
1105+
group_model_instances = "Commands related to Kaggle model variations"
1106+
group_model_instance_versions = "Commands related to Kaggle model variations versions"
11071107
group_files = "Commands related files"
11081108
group_config = "Configuration settings"
11091109
group_auth = "Commands related to authentication"
@@ -1320,12 +1320,12 @@ class Help(object):
13201320
)
13211321

13221322
# Model Instances params
1323-
param_model_instance = "Model Instance URL suffix in format <owner>/<model-name>/<framework>/<instance-slug>"
1324-
command_model_instances_get = "Get a model instance"
1325-
command_model_instances_init = "Initialize metadata file for model instance creation"
1326-
command_model_instances_files = "List files for the current version of a model instance"
1327-
command_model_instances_list = "List instances of a model"
1328-
command_model_instances_new = "Create a new model instance"
1323+
param_model_instance = "Model variation URL suffix in format <owner>/<model-name>/<framework>/<instance-slug>"
1324+
command_model_instances_get = "Get a model variation"
1325+
command_model_instances_init = "Initialize metadata file for model variation creation"
1326+
command_model_instances_files = "List files for the current version of a model variation"
1327+
command_model_instances_list = "List variations of a model"
1328+
command_model_instances_new = "Create a new model variation"
13291329
param_model_instance_downfile = (
13301330
"Folder for downloading the special model-instance-metadata.json file "
13311331
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/models_metadata.md#model-instance). "
@@ -1336,22 +1336,22 @@ class Help(object):
13361336
"(https://github.com/Kaggle/kaggle-cli/blob/main/docs/models_metadata.md#model-instance). "
13371337
"Defaults to current working directory"
13381338
)
1339-
command_model_instances_delete = "Delete a model instance"
1340-
command_model_instances_update = "Update a model instance"
1339+
command_model_instances_delete = "Delete a model variation"
1340+
command_model_instances_update = "Update a model variation"
13411341

13421342
# Model Instance Versions params
13431343
param_model_instance_version = (
1344-
"Model Instance Version URL suffix in format <owner>/<model-name>/<framework>/<instance-slug>/<version-number>"
1344+
"Model variation version URL suffix in format <owner>/<model-name>/<framework>/<variation-slug>/<version-number>"
13451345
)
13461346

13471347
# Model Instance Versions params
1348-
command_model_instance_versions_new = "Create a new model instance version"
1348+
command_model_instance_versions_new = "Create a new model variation version"
13491349
param_model_instance_version_upfile = "Folder for upload. Defaults to current working directory"
1350-
command_model_instance_versions_delete = "Delete a model instance version"
1351-
command_model_instance_versions_download = "Download model instance version files"
1352-
command_model_instance_versions_files = "List model instance version files"
1353-
command_model_instance_versions_list = "List model instance versions"
1354-
param_model_instance_version_notes = "Version notes to record for the new model instance version"
1350+
command_model_instance_versions_delete = "Delete a model variation version"
1351+
command_model_instance_versions_download = "Download model variation version files"
1352+
command_model_instance_versions_files = "List model variation version files"
1353+
command_model_instance_versions_list = "List model variation versions"
1354+
param_model_instance_version_notes = "Version notes to record for the new model variation version"
13551355

13561356
# Files params
13571357
param_files_upload_inbox_path = "Virtual path on the server where the uploaded files will be stored"

0 commit comments

Comments
 (0)