From a89a665414dd7be3b2fb21280611e494259acacb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Thu, 31 Oct 2024 01:22:58 +0800 Subject: [PATCH 1/2] Add Phoenix examples readme to docs --- examples/phoenix/README.md | 6 +++--- mix.exs | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/examples/phoenix/README.md b/examples/phoenix/README.md index c13c7186..1900fd43 100644 --- a/examples/phoenix/README.md +++ b/examples/phoenix/README.md @@ -1,6 +1,6 @@ # Phoenix LiveView examples -This directory contains minimal, single-file LiveView applications, which showcase how to integrate Bumblebee as part of the application. +The [examples/phoenix](https://github.com/elixir-nx/bumblebee/tree/main/examples/phoenix) directory contains contains minimal, single-file LiveView applications, which showcase how to integrate Bumblebee as part of the application. ## Running @@ -89,12 +89,12 @@ When working with user-given images, the most trivial approach would be to just Both of these downsides can be avoided by moving all the work to the client. Specifically, when the user selects an image, we can resize it to a much smaller version and decode to pixel values right away. Both of these steps are fairly straightforward using the Canvas API. -For an example implementation of this technique see the [image classification example](image_classification.exs). +For an example implementation of this technique see the [image classification example](https://github.com/elixir-nx/bumblebee/tree/main/examples/phoenix/image_classification.exs). ### User audio The points made about images above are relevant to user-given audio as well. In fact, decoding audio files on the server requires ffmpeg to be installed system-wide. However, we can do all preprocessing on the client and send raw PCM data with a single channel to the server. -For an example implementation of this technique see the [speech-to-text example](speech_to_text.exs). +For an example implementation of this technique see the [speech-to-text example](https://github.com/elixir-nx/bumblebee/tree/main/examples/phoenix/speech_to_text.exs). If you are interested in real-time streaming, look at the [Membrane Framework](https://github.com/membraneframework/membrane_core). diff --git a/mix.exs b/mix.exs index bbe4aa3b..93b6157d 100644 --- a/mix.exs +++ b/mix.exs @@ -63,7 +63,8 @@ defmodule Bumblebee.MixProject do "notebooks/stable_diffusion.livemd", "notebooks/llms.livemd", "notebooks/llms_rag.livemd", - "notebooks/fine_tuning.livemd" + "notebooks/fine_tuning.livemd", + "examples/phoenix/README.md" ], extra_section: "GUIDES", groups_for_modules: [ From de2f8f5ba3d67097cc4c6b3dc81ee18d31ac6ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Wed, 30 Oct 2024 18:33:51 +0100 Subject: [PATCH 2/2] Update examples/phoenix/README.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Valim --- examples/phoenix/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/phoenix/README.md b/examples/phoenix/README.md index 1900fd43..fb1d0640 100644 --- a/examples/phoenix/README.md +++ b/examples/phoenix/README.md @@ -1,6 +1,6 @@ # Phoenix LiveView examples -The [examples/phoenix](https://github.com/elixir-nx/bumblebee/tree/main/examples/phoenix) directory contains contains minimal, single-file LiveView applications, which showcase how to integrate Bumblebee as part of the application. +The [examples/phoenix](https://github.com/elixir-nx/bumblebee/tree/main/examples/phoenix) directory contains minimal, single-file LiveView applications, which showcase how to integrate Bumblebee as part of the application. ## Running