Skip to content

Commit 4b545ad

Browse files
authored
Update python and rust dependencies (IBM#56)
Including transformers 4.38.2 --------- Signed-off-by: Nick Hill <[email protected]>
1 parent 0cc4a2e commit 4b545ad

File tree

8 files changed

+723
-647
lines changed

8 files changed

+723
-647
lines changed

Cargo.lock

Lines changed: 432 additions & 359 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration_tests/poetry.lock

Lines changed: 120 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

integration_tests/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ python = ">=3.11"
99

1010
[tool.poetry.group.dev.dependencies]
1111
protobuf = "^4.25.3"
12-
grpcio-tools = "^1.60.1"
13-
pytest = "^8.0.1"
14-
pytest-asyncio = "^0.23.3"
12+
grpcio-tools = "^1.62.1"
13+
pytest = "^8.0.2"
14+
pytest-asyncio = "^0.23.5"
1515
requests = "^2.31.0"
1616
pyyaml = "^6.0.1"
1717

launcher/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ authors = ["Olivier Dehaene"]
66
description = "Text Generation Launcher"
77

88
[dependencies]
9-
clap = { version = "4.5.1", features = ["derive", "env"] }
9+
clap = { version = "4.5.2", features = ["derive", "env"] }
1010
ctrlc = { version = "3.4.2", features = ["termination"] }
1111
nix = { version = "0.28.0", features = ["process", "signal"] }
1212
serde_json = "^1.0.114"

router/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ path = "src/main.rs"
1616
[dependencies]
1717
axum = { version = "0.6.20", features = ["json"] }
1818
text-generation-client = { path = "client" }
19-
clap = { version = "^4.5.1", features = ["derive", "env"] }
19+
clap = { version = "^4.5.2", features = ["derive", "env"] }
2020
futures = "^0.3.30"
2121
flume = "^0.11.0"
2222
metrics = "0.21.1"

server/poetry.lock

Lines changed: 157 additions & 155 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

server/pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ text-generation-server = 'text_generation_server.cli:app'
1010
[tool.poetry.dependencies]
1111
python = ">=3.11.0,<3.13"
1212
protobuf = "^4.25.3"
13-
grpcio = "^1.60.1"
14-
grpcio-reflection = "^1.60.1"
13+
grpcio = "^1.62.1"
14+
grpcio-reflection = "^1.62.1"
1515
loguru = "^0.7.2"
1616
typer = "^0.9.0"
1717
accelerate = { version = "0.27.2", optional = true }
@@ -21,10 +21,10 @@ safetensors = "^0.4.2"
2121
sentencepiece = "^0.2.0"
2222
datasets = { version = "^2.15.0", optional = true }
2323
texttable = { version = "^1.7.0", optional = true }
24-
transformers = "4.38.0"
24+
transformers = "4.38.2"
2525
optimum = { version = "^1.17.1", extras = ["onnxruntime-gpu"], optional = true }
26-
onnxruntime = { version = "^1.17.0", optional = true }
27-
onnxruntime-gpu = { version = "^1.16.3", optional = true }
26+
onnxruntime = { version = "^1.17.1", optional = true }
27+
onnxruntime-gpu = { version = "^1.17.1", optional = true }
2828
onnx = { version = "^1.15.0", optional = true }
2929
einops = "^0.7.0"
3030
ibm-fms = { version = "^0.0", optional = true }
@@ -48,7 +48,7 @@ onnx-gpu = ["optimum", "onnxruntime-gpu", "onnx"]
4848
quantize = ["datasets", "texttable"]
4949

5050
[tool.poetry.group.dev.dependencies]
51-
grpcio-tools = "^1.60.1"
51+
grpcio-tools = "^1.62.1"
5252
pytest = "^8.0.1"
5353

5454
[build-system]

server/text_generation_server/models/causal_lm.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ def forward(
608608
) -> Tuple[torch.Tensor, List[Tuple[torch.Tensor, torch.Tensor]], int]:
609609
model_inputs = self.model.prepare_inputs_for_generation(
610610
input_ids, past_key_values,
611+
inputs_embeds=inputs_embeds,
611612
attention_mask=attention_mask,
612613
position_ids=position_ids,
613614
use_cache=True,
@@ -619,8 +620,8 @@ def forward(
619620
# This can be incorrectly overwritten to None in prepare_inputs_for_generation
620621
model_inputs["position_ids"] = position_ids
621622

622-
if inputs_embeds is not None:
623-
# Add embeddings - if non-None then input_ids should be None
623+
if inputs_embeds is not None and "inputs_embeds" not in model_inputs:
624+
# Ensure that embeddings were added - if non-None then input_ids should be None
624625
model_inputs["inputs_embeds"] = inputs_embeds
625626

626627
# Model Forward

0 commit comments

Comments
 (0)