Skip to content

Commit

Permalink
Release v0.3.0 (#201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonatanklosko authored Apr 14, 2023
1 parent 150612e commit dc3cfee
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 10 deletions.
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion examples/phoenix/image_classification.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
])
Expand Down
6 changes: 3 additions & 3 deletions examples/phoenix/speech_to_text.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
])
Expand Down Expand Up @@ -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]
)
Expand Down
2 changes: 1 addition & 1 deletion examples/phoenix/text_classification.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
])
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion notebooks/fine_tuning.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion notebooks/stable_diffusion.livemd
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down

0 comments on commit dc3cfee

Please sign in to comment.