diff --git a/CHANGELOG.md b/CHANGELOG.md index 4f7aa32d..a74b76ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,40 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v0.3.0](https://github.com/elixir-nx/bumblebee/tree/v0.3.0) (2023-04-14) + +In this release we moved all generation options to a new `%Bumblebee.Text.GenerationConfig{}` struct, which needs to be explicitly loaded and configured. A number of generation options is model-specific and they used to be a part of model specification, but encapsulating everything in a single struct improves the transparency of options origin and reconfiguration. The text generation servings (generation, speech-to-text and conversation) need to be adjusted as follows: + +```diff +{:ok, model_info} = Bumblebee.load_model({:hf, "gpt2"}) +{:ok, tokenizer} = Bumblebee.load_tokenizer({:hf, "gpt2"}) ++{:ok, generation_config} = Bumblebee.load_generation_config({:hf, "gpt2"}) + ++generation_config = Bumblebee.configure(generation_config, max_new_tokens: 100) ++serving = Bumblebee.Text.generation(model_info, tokenizer, generation_config) +-serving = Bumblebee.Text.generation(model_info, tokenizer, max_new_tokens: 100) +``` + +### Added + +* Word-based aggregations for token classification ([#174](https://github.com/elixir-nx/bumblebee/pull/174)) +* BLIP model ([#181](https://github.com/elixir-nx/bumblebee/pull/181)) +* Text-to-image serving ([#181](https://github.com/elixir-nx/bumblebee/pull/181)) +* Generation option to avoid repeated n-grams ([#182](https://github.com/elixir-nx/bumblebee/pull/182)) +* Blenderbot model ([#177](https://github.com/elixir-nx/bumblebee/pull/177)) +* Option to load models from cache without outgoing traffic ([#183](https://github.com/elixir-nx/bumblebee/pull/183)) +* Whisper Phoenix demo ([#184](https://github.com/elixir-nx/bumblebee/pull/184)) +* Image channels normalization in featurizers ([#189](https://github.com/elixir-nx/bumblebee/pull/189)) +* T5 encoder model ([#190](https://github.com/elixir-nx/bumblebee/pull/190)) +* Contrastive search for sequence generation ([#192](https://github.com/elixir-nx/bumblebee/pull/192)) +* Multinomial sampling for sequence generation ([#161](https://github.com/elixir-nx/bumblebee/pull/161)) +* Support for loading sharded params checkpoints ([#200](https://github.com/elixir-nx/bumblebee/pull/200)) + +### Changed + +* Model loading to not log params diff if everything is loaded correctly ([#186](https://github.com/elixir-nx/bumblebee/pull/186)) +* Moved all generation options to a new `%Bumblebee.Text.GenerationConfig{}` struct ([#193](https://github.com/elixir-nx/bumblebee/pull/193)) + ## [v0.2.0](https://github.com/elixir-nx/bumblebee/tree/v0.2.0) (2023-03-16) ### Added diff --git a/README.md b/README.md index 97ce94f2..5842ae9b 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ First add Bumblebee and EXLA as dependencies in your `mix.exs`. EXLA is an optio ```elixir def deps do [ - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:exla, ">= 0.0.0"} ] end @@ -37,7 +37,7 @@ In notebooks and scripts, use the following `Mix.install/2` call to both install ```elixir Mix.install( [ - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:exla, ">= 0.0.0"} ], config: [nx: [default_backend: EXLA.Backend]] diff --git a/examples/phoenix/image_classification.exs b/examples/phoenix/image_classification.exs index 3aadff7d..8c0729e9 100644 --- a/examples/phoenix/image_classification.exs +++ b/examples/phoenix/image_classification.exs @@ -12,7 +12,7 @@ Mix.install([ {:phoenix, "~> 1.7.0"}, {:phoenix_live_view, "~> 0.18.3"}, # Bumblebee and friends - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:nx, "~> 0.5.1"}, {:exla, "~> 0.5.1"} ]) diff --git a/examples/phoenix/speech_to_text.exs b/examples/phoenix/speech_to_text.exs index 7828729c..99f72cb0 100644 --- a/examples/phoenix/speech_to_text.exs +++ b/examples/phoenix/speech_to_text.exs @@ -12,7 +12,7 @@ Mix.install([ {:phoenix, "~> 1.7.0"}, {:phoenix_live_view, "~> 0.18.3"}, # Bumblebee and friends - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:nx, "~> 0.5.1"}, {:exla, "~> 0.5.1"} ]) @@ -312,10 +312,10 @@ end {:ok, model_info} = Bumblebee.load_model({:hf, "openai/whisper-tiny"}) {:ok, featurizer} = Bumblebee.load_featurizer({:hf, "openai/whisper-tiny"}) {:ok, tokenizer} = Bumblebee.load_tokenizer({:hf, "openai/whisper-tiny"}) +{:ok, generation_config} = Bumblebee.load_generation_config({:hf, "openai/whisper-tiny"}) serving = - Bumblebee.Audio.speech_to_text(model_info, featurizer, tokenizer, - max_new_tokens: 100, + Bumblebee.Audio.speech_to_text(model_info, featurizer, tokenizer, generation_config, compile: [batch_size: 10], defn_options: [compiler: EXLA] ) diff --git a/examples/phoenix/text_classification.exs b/examples/phoenix/text_classification.exs index 9d558219..11cca518 100644 --- a/examples/phoenix/text_classification.exs +++ b/examples/phoenix/text_classification.exs @@ -11,7 +11,7 @@ Mix.install([ {:phoenix, "~> 1.7.0"}, {:phoenix_live_view, "~> 0.18.3"}, # Bumblebee and friends - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:nx, "~> 0.5.1"}, {:exla, "~> 0.5.1"} ]) diff --git a/mix.exs b/mix.exs index 736251b6..febfce32 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule Bumblebee.MixProject do use Mix.Project - @version "0.2.0" + @version "0.3.0" @description "Pre-trained and transformer Neural Network models in Axon" def project do diff --git a/notebooks/fine_tuning.livemd b/notebooks/fine_tuning.livemd index a116075e..f5837ed7 100644 --- a/notebooks/fine_tuning.livemd +++ b/notebooks/fine_tuning.livemd @@ -4,7 +4,7 @@ ```elixir Mix.install([ - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:axon, "~> 0.5.1"}, {:nx, "~> 0.5.1"}, {:exla, "~> 0.5.1"}, diff --git a/notebooks/stable_diffusion.livemd b/notebooks/stable_diffusion.livemd index 024afa50..2740aa06 100644 --- a/notebooks/stable_diffusion.livemd +++ b/notebooks/stable_diffusion.livemd @@ -2,7 +2,7 @@ ```elixir Mix.install([ - {:bumblebee, "~> 0.2.0"}, + {:bumblebee, "~> 0.3.0"}, {:nx, "~> 0.5.1"}, {:exla, "~> 0.5.1"}, {:kino, "~> 0.8.0"}