Skip to content

Commit b164b4b

Browse files
committed
Just kidding, let's try that again and hopefully fix quality and tests
1 parent 0263361 commit b164b4b

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

src/guidellm/benchmark/entrypoints.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from pathlib import Path
2-
from typing import Any, Callable, Dict, Iterable, List, Literal, Optional, Union
2+
from typing import Any, Dict, Iterable, List, Literal, Optional, Union
33

44
from datasets import Dataset, DatasetDict, IterableDataset, IterableDatasetDict
5-
from transformers import PreTrainedTokenizer # type: ignore[import]
5+
from transformers import ( # type: ignore[import]
6+
PreTrainedTokenizerBase,
7+
)
68

79
from guidellm.backend import Backend, BackendType
810
from guidellm.benchmark.benchmark import GenerativeBenchmark
@@ -22,7 +24,7 @@ async def benchmark_generative_text(
2224
backend_type: BackendType,
2325
backend_args: Optional[Dict[str, Any]],
2426
model: Optional[str],
25-
processor: Optional[Union[str, Path, PreTrainedTokenizer, Callable]],
27+
processor: Optional[Optional[Union[str, Path, PreTrainedTokenizerBase]]],
2628
processor_args: Optional[Dict[str, Any]],
2729
data: Union[
2830
str,

src/guidellm/dataset/entrypoints.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from pathlib import Path
12
from typing import Any, Dict, List, Optional, Tuple, Union
23

34
from datasets import Dataset, IterableDataset
@@ -15,7 +16,7 @@
1516
def load_dataset(
1617
data: Any,
1718
data_args: Optional[Dict[str, Any]],
18-
processor: PreTrainedTokenizerBase,
19+
processor: Optional[Union[str, Path, PreTrainedTokenizerBase]],
1920
processor_args: Optional[Dict[str, Any]],
2021
random_seed: int = 42,
2122
split_pref_order: Optional[List[str]] = None,

src/guidellm/objects/statistics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,14 @@ def from_distribution_function(
117117
:return: An instance of DistributionSummary with calculated values.
118118
"""
119119
values, weights = zip(*distribution) if distribution else ([], [])
120-
values = np.array(values)
121-
weights = np.array(weights)
120+
values = np.array(values) # type: ignore[assignment]
121+
weights = np.array(weights) # type: ignore[assignment]
122122

123123
# create the PDF
124124
probabilities = weights / np.sum(weights) # type: ignore[operator]
125125
pdf = np.column_stack((values, probabilities))
126126
pdf = pdf[np.argsort(pdf[:, 0])]
127-
values = pdf[:, 0]
127+
values = pdf[:, 0] # type: ignore[assignment]
128128
probabilities = pdf[:, 1]
129129

130130
# calculate the CDF

tests/e2e/test_placeholder.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
import pytest
2+
3+
4+
@pytest.mark.smoke()
15
def test_placeholder():
26
assert True
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
import pytest
2+
3+
4+
@pytest.mark.smoke()
15
def test_placeholder():
26
assert True

0 commit comments

Comments
 (0)