Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Load the previously trained model for handwritten digits classification.
>

```python
model = tf.keras.models.load_model("model/sketch_recognition_numbers_model.h5")
model = tf.keras.models.load_model("model/sketch_recognition_numbers_model.h5", compile=False)
```

Create the function that recognizes the written number.
Expand Down Expand Up @@ -158,26 +158,27 @@ CMD [ "python3" , "/workspace/app.py" ]

### Build the Docker image from the Dockerfile

Launch the following command from the **Dockerfile** directory to build your application image:
From the directory containing your **Dockerfile**, run one of the following commands to build your application image:

```console
# Build the image using your machine's default architecture
docker build . -t gradio_app:latest

# Build image targeting the linux/amd64 architecture
docker buildx build --platform linux/amd64 -t gradio_app:latest .
```

- The **first command** builds the image using your system’s default architecture. This may work if your machine already uses the `linux/amd64` architecture, which is required to run containers with our AI products. However, on systems with a different architecture (e.g. `ARM64` on `Apple Silicon`), the resulting image will not be compatible and cannot be deployed.

- The **second command** explicitly targets the `linux/AMD64` architecture to ensure compatibility with our AI services. This requires `buildx`, which is not installed by default. If you haven’t used `buildx` before, you can install it by running: `docker buildx install`

> [!primary]
>
> The dot `.` argument indicates that your build context (place of the **Dockerfile** and other needed files) is the current directory.
>
> The `-t` argument allows you to choose the identifier to give to your image. Usually image identifiers are composed of a **name** and a **version tag** `<name>:<version>`. For this example we chose **gradio_app:latest**.
>

> [!warning]
>
> Please make sure that the docker image you will push in order to run containers using AI products respects the **linux/AMD64** target architecture. You could, for instance, build your image using **buildx** as follows:
>
> `docker buildx build --platform linux/amd64 ...`
>

### Push the image into the shared registry

> [!warning]
Expand Down Expand Up @@ -211,7 +212,7 @@ The following command starts a new AI Deploy app running your Gradio application
```console
ovhai app run \
--cpu 1 \
--volume <my_saved_model>@<region>/:/workspace/model:RO \
--volume <my_saved_model>@<region>/model/:/workspace/model:RO \
<shared-registry-address>/gradio_app:latest
```

Expand Down