diff --git a/lib/bumblebee/audio.ex b/lib/bumblebee/audio.ex index 86243ebc..6f2afaaf 100644 --- a/lib/bumblebee/audio.ex +++ b/lib/bumblebee/audio.ex @@ -43,7 +43,7 @@ defmodule Bumblebee.Audio do @type audio :: Nx.t() | {:file, String.t()} @type speech_to_text_whisper_input :: - audio() | %{:audio => audio(), optional(:seed) => integer()} + audio() | %{:audio => audio(), optional(:seed) => integer() | nil} @type speech_to_text_whisper_output :: %{ chunks: list(speech_to_text_whisper_chunk()) } diff --git a/lib/bumblebee/diffusion/stable_diffusion.ex b/lib/bumblebee/diffusion/stable_diffusion.ex index b6dd7f85..1ba46f75 100644 --- a/lib/bumblebee/diffusion/stable_diffusion.ex +++ b/lib/bumblebee/diffusion/stable_diffusion.ex @@ -12,8 +12,8 @@ defmodule Bumblebee.Diffusion.StableDiffusion do String.t() | %{ :prompt => String.t(), - optional(:negative_prompt) => String.t(), - optional(:seed) => integer() + optional(:negative_prompt) => String.t() | nil, + optional(:seed) => integer() | nil } @type text_to_image_output :: %{results: list(text_to_image_result())} @type text_to_image_result :: %{:image => Nx.Tensor.t(), optional(:is_safe) => boolean()} diff --git a/lib/bumblebee/text.ex b/lib/bumblebee/text.ex index 90b2d128..6544697a 100644 --- a/lib/bumblebee/text.ex +++ b/lib/bumblebee/text.ex @@ -127,7 +127,7 @@ defmodule Bumblebee.Text do to: Bumblebee.Text.TokenClassification @type generation_input :: - String.t() | %{:text => String.t(), optional(:seed) => integer()} + String.t() | %{:text => String.t(), optional(:seed) => integer() | nil} @type generation_output :: %{results: list(generation_result())} @type generation_result :: %{text: String.t(), token_summary: token_summary()} @type token_summary :: %{ diff --git a/lib/bumblebee/vision.ex b/lib/bumblebee/vision.ex index 27e82d1d..e1b54052 100644 --- a/lib/bumblebee/vision.ex +++ b/lib/bumblebee/vision.ex @@ -86,7 +86,7 @@ defmodule Bumblebee.Vision do defdelegate image_classification(model_info, featurizer, opts \\ []), to: Bumblebee.Vision.ImageClassification - @type image_to_text_input :: image() | %{:image => image(), optional(:seed) => integer()} + @type image_to_text_input :: image() | %{:image => image(), optional(:seed) => integer() | nil} @type image_to_text_output :: %{results: list(image_to_text_result())} @type image_to_text_result :: %{text: String.t()}