Skip to content

Commit

Permalink
chore(dependencies): update transformers to v4.46.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tengomucho committed Nov 28, 2024
1 parent 73866d6 commit 6bf378e
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ keywords = [
]

dependencies = [
"transformers == 4.41.1",
"transformers == 4.46.3",
"torch == 2.5.1",
"torch-xla[tpu] == 2.5.1",
'typer == 0.6.1',
Expand Down
2 changes: 1 addition & 1 deletion text-generation-inference/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ RUN apt-get update -y \
RUN pip install --upgrade pip

# Install HuggingFace packages
ARG TRANSFORMERS_VERSION='4.41.1'
ARG TRANSFORMERS_VERSION='4.46.3'
ARG ACCELERATE_VERSION='1.1.1'
ARG SAFETENSORS_VERSION='0.4.2'

Expand Down
2 changes: 1 addition & 1 deletion text-generation-inference/server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies = [
'grpc-interceptor == 0.15.2',
'typer == 0.6.1',
'safetensors == 0.4.2',
'transformers == 4.41.1',
'transformers == 4.46.3',
'loguru == 0.6.0',
"sentencepiece == 0.2.0",
"numpy<2.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ def __init__(
tokenizer.truncation_side = "left"
self.tokenizer = tokenizer
self.special_tokens = self.tokenizer.all_special_ids
# The token selector will use the model's generation mixin internal variables to select the next token, and it
# expects special tokens to be initialized in the model.
model._prepare_special_tokens(generation_config=model.generation_config, device=model.device)
# Slots are empty to begin with, they will be populated as new batches arrive
self.slots = []
self.batch_id = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,10 @@ def __init__(
tokenizer.truncation_side = "left"
self.tokenizer = tokenizer
self.special_tokens = self.tokenizer.all_special_ids
# The token selector will use the model's generation mixin internal variables to select the next token, and it
# expects special tokens to be initialized in the model.
model = self.engine.pt_model
model._prepare_special_tokens(generation_config=model.generation_config, device='cpu')
# Slots number is static, it cannot grow over the size of the batch
self.slots = [Slot(i, tokenizer) for i in range(self.model.config.batch_size)]
self.batch_id = 0
Expand Down

0 comments on commit 6bf378e

Please sign in to comment.