From 5b3d7acb3ce5efae3b0e65fbcc0c9b90ccd2f227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Wed, 21 Feb 2024 18:30:17 +0700 Subject: [PATCH] Remove deprecations --- CHANGELOG.md | 1 + lib/bumblebee/audio.ex | 26 -------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0b762b7..5e01aa8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ This release changes the directory structure of the models cache, such that cach * Removed the serving `:seed` option in favour of a runtime, per-input seed ([#303](https://github.com/elixir-nx/bumblebee/pull/303)) * Conversational serving ([#308](https://github.com/elixir-nx/bumblebee/pull/308)) * Specific tokenizer modules in favour of a single module ([#310](https://github.com/elixir-nx/bumblebee/pull/310)) +* Removed the deprecated `Bumblebee.Audio.speech_to_text/5` (in favour of the more specific `speech_to_text_whisper/5`) ### Fixed diff --git a/lib/bumblebee/audio.ex b/lib/bumblebee/audio.ex index 6f2afaaf..c38c0b45 100644 --- a/lib/bumblebee/audio.ex +++ b/lib/bumblebee/audio.ex @@ -3,32 +3,6 @@ defmodule Bumblebee.Audio do High-level tasks related to audio processing. """ - # TODO: remove in v0.5 - @deprecated "Use Bumblebee.Audio.speech_to_text_whisper/5 instead." - def speech_to_text(model_info, featurizer, tokenizer, generation_config, opts \\ []) do - serving = speech_to_text_whisper(model_info, featurizer, tokenizer, generation_config, opts) - client_postprocessing = serving.client_postprocessing - - Nx.Serving.client_postprocessing(serving, fn output_pair, info -> - output = client_postprocessing.(output_pair, info) - - if is_list(output) do - Enum.map(output, &speech_to_text_convert_output/1) - else - speech_to_text_convert_output(output) - end - end) - end - - defp speech_to_text_convert_output(%{chunks: chunks}) do - text = - chunks - |> Enum.map_join(& &1.text) - |> String.trim() - - %{results: [%{text: text}]} - end - @typedoc """ A term representing audio.