# 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="/files/Kkv9gXneHJfYYLS3GuvW" 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="/files/eNvlhY8R8wyPedlLYics" 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="/pages/YApNAqisqIbe17eFghB7">/pages/YApNAqisqIbe17eFghB7</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="/pages/yyygZPyF40EbYlvQ9c8d">/pages/yyygZPyF40EbYlvQ9c8d</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="/pages/BPAsR6EAOJexajZPitzW">/pages/BPAsR6EAOJexajZPitzW</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="/pages/IapDkZzfM7mN9ePptZcb">/pages/IapDkZzfM7mN9ePptZcb</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="/pages/neh6VHbUO1k5sjbJcIiZ">/pages/neh6VHbUO1k5sjbJcIiZ</a></td></tr><tr><td><strong>More examples</strong></td><td>Open source from community and Float16 team.</td><td><a href="/pages/WofUCY294VqyFMOY62JX">/pages/WofUCY294VqyFMOY62JX</a></td></tr></tbody></table>

Happy coding with Float16 Serverless GPU!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.float16.cloud/getting-started/serverless-gpu/tutorials/direct-upload-and-download.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
