Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typos and improve language #381

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/bumblebee/audio/whisper_featurizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defmodule Bumblebee.Audio.WhisperFeaturizer do
num_seconds: [
default: 30,
doc: """
the maximum duration of the audio sequence. This implies that the the maximum length of the
the maximum duration of the audio sequence. This implies that the maximum length of the
input sequence is `:num_seconds` * `:sampling_rate`
"""
],
Expand Down
2 changes: 1 addition & 1 deletion lib/bumblebee/layers/transformer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ defmodule Bumblebee.Layers.Transformer do

Alternatively a custom 2-arity function may be given. The function
should add a normalization node to the given Axon node. The function
also receives layer name prefix as the second argument.
also receives the layer name prefix as the second argument.

* `:block_type` - controls which configuration of the block to use,
one of:
Expand Down
2 changes: 1 addition & 1 deletion lib/bumblebee/shared.ex
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ defmodule Bumblebee.Shared do
use_cross_attention: [
default: false,
doc:
"whether cross-attention layers should be added to the model." <>
"whether cross-attention layers should be added to the model. " <>
"This is only relevant for decoder models"
]
]
Expand Down
4 changes: 2 additions & 2 deletions lib/bumblebee/tokenizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ defmodule Bumblebee.Tokenizer do
end

@doc """
Converts the given token id the corresponding token.
Converts the given token id to the corresponding token.
"""
@spec token_to_id(t(), token_id()) :: token()
@spec id_to_token(t(), token_id()) :: token()
def id_to_token(%module{} = tokenizer, id) do
module.id_to_token(tokenizer, id)
end
Expand Down
6 changes: 3 additions & 3 deletions lib/bumblebee/vision/blip_featurizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ defmodule Bumblebee.Vision.BlipFeaturizer do
images = List.wrap(images)

for image <- images do
images =
image =
image
|> Image.to_batched_tensor()
|> Nx.as_type(:f32)
|> Image.normalize_channels(length(featurizer.image_mean))

if featurizer.resize do
%{height: height, width: width} = featurizer.size
NxImage.resize(images, {height, width}, method: featurizer.resize_method)
NxImage.resize(image, {height, width}, method: featurizer.resize_method)
else
images
image
end
end
|> Nx.concatenate()
Expand Down
6 changes: 3 additions & 3 deletions lib/bumblebee/vision/vit_featurizer.ex
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ defmodule Bumblebee.Vision.VitFeaturizer do
images = List.wrap(images)

for image <- images do
images =
image =
image
|> Image.to_batched_tensor()
|> Nx.as_type(:f32)
|> Image.normalize_channels(length(featurizer.image_mean))

if featurizer.resize do
%{height: height, width: width} = featurizer.size
NxImage.resize(images, {height, width}, method: featurizer.resize_method)
NxImage.resize(image, {height, width}, method: featurizer.resize_method)
else
images
image
end
end
|> Nx.concatenate()
Expand Down
Loading