# Direct upload and download

This tutorial guides you through upload and download using Float16's storage.

{% hint style="info" %}

* Float16 CLI installed
* Logged into Float16 account
* VSCode or preferred text editor recommended
  {% endhint %}

## Step 1 : Create and start the project

```
float16 project create --instance h100
float16 project start
```

{% hint style="info" %}
If you didn't start the project, You can't use storage command before start the project.
{% endhint %}

## Step 2 : Prepare the script

<https://github.com/float16-cloud/examples/tree/main/official/spot/torch-train-and-infernce-mnist>

(download-mnist-datasets.py)

```python
import os
from torchvision import datasets, transforms

def download_mnist(data_path):
    if not os.path.exists(data_path):
        os.makedirs(data_path)
    
    transform = transforms.Compose([
        transforms.ToTensor(),
        transforms.Normalize((0.1307,), (0.3081,))
    ])

    # Download training data
    train_dataset = datasets.MNIST(root=data_path, train=True, download=True, transform=transform)
    
    # Download test data
    test_dataset = datasets.MNIST(root=data_path, train=False, download=True, transform=transform)

    print(f"MNIST dataset downloaded and saved to {data_path}")

if __name__ == "__main__":
    data_path = "../mnist-datasets"  # You can change this to your preferred location
    download_mnist(data_path)
```

## Step 3.1 : Upload via CLI

After downloaded. Use this command to upload datasets directory to remote path.

```python
float16 storage upload -f ./mnist-datasets -d datasets
```

{% hint style="info" %}

* The **storage upload** command use direct connect between your local machine direct to&#x20;
  {% endhint %}

## Step 3.2 : Upload via Website

<figure><img src="https://3153350778-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F06IkMLrrm1ptUT8449HF%2Fuploads%2FLo6s5rzoTOqS2r9p7kON%2Fimage.png?alt=media&#x26;token=fbf8ec5c-f2ad-4c39-a9a0-1da709c89ec0" alt=""><figcaption></figcaption></figure>

## Step 4.1 : Download the file(s) via CLI

```
float16 storage download -f datasets -d ./local_datasets
```

## Step 4.2 : Download the file(s) via Website

<figure><img src="https://3153350778-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F06IkMLrrm1ptUT8449HF%2Fuploads%2FpUP80asSsa32gZHpzb3x%2Fimage.png?alt=media&#x26;token=1ff50a6f-6646-4e77-90bf-22ef59d298e3" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Congratulations! You've successfully use your first server mode on Float16's serverless GPU platform.
{% endhint %}

## Explore More&#x20;

Learn how to use Float16 CLI for various use cases in our tutorials.

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Hello World</strong></td><td>Launch your first serverless GPU function and kickstart your journey.</td><td><a href="hello-world">hello-world</a></td></tr><tr><td><strong>Install new library</strong></td><td>Enhance your toolkit by adding new libraries tailored to your project needs.</td><td><a href="install-new-library">install-new-library</a></td></tr><tr><td><strong>Copy output from remote</strong></td><td>Efficiently transfer computation results from remote to your local storage.</td><td><a href="s3-copy-output-from-remote">s3-copy-output-from-remote</a></td></tr><tr><td><strong>Deploy FastAPI Helloworld</strong></td><td>Quick start to deploy FastAPI without change the code.</td><td><a href="server-mode">server-mode</a></td></tr><tr><td><strong>Upload and Download via CLI and Website</strong></td><td>Direct upload and download file(s) to server.</td><td><a href="direct-upload-and-download">direct-upload-and-download</a></td></tr><tr><td><strong>More examples</strong></td><td>Open source from community and Float16 team.</td><td><a href="etc.">etc.</a></td></tr></tbody></table>

Happy coding with Float16 Serverless GPU!
