Skip to content

Commit

Permalink
Fix typos and improve language (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
preciz authored Jul 26, 2024
1 parent aeee6cf commit a75f6b7
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
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

0 comments on commit a75f6b7

Please sign in to comment.