Skip to content

Commit 40b8eeb

Browse files
authored
Merge pull request #192055 from nibaccam/patch-35
Replace upload() method
2 parents a92feb3 + ba73f8c commit 40b8eeb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

articles/machine-learning/tutorial-1st-experiment-bring-data.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,14 @@ To run this script in Azure Machine Learning, you need to make your training dat
169169
```python
170170
# upload-data.py
171171
from azureml.core import Workspace
172+
from azureml.core import Dataset
173+
from azureml.data.datapath import DataPath
174+
172175
ws = Workspace.from_config()
173176
datastore = ws.get_default_datastore()
174-
datastore.upload(src_dir='./data',
175-
target_path='datasets/cifar10',
176-
overwrite=True)
177-
177+
Dataset.File.upload_directory(src_dir='data',
178+
target=DataPath(datastore, "datasets/cifar10")
179+
)
178180
```
179181

180182
The `target_path` value specifies the path on the datastore where the CIFAR10 data will be uploaded.

0 commit comments

Comments
 (0)