Skip to content

Commit

Permalink
model_run_utils: add/fix type hints
Browse files Browse the repository at this point in the history
Signed-off-by: Daniele Trifirò <[email protected]>
  • Loading branch information
dtrifiro committed Oct 2, 2023
1 parent ef283e4 commit eab5fcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions caikit_nlp/toolkit/text_generation/model_run_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

# Third Party
from peft.peft_model import PeftModel
from transformers import StoppingCriteria, TextStreamer
from transformers import AutoModel, AutoTokenizer, StoppingCriteria, TextStreamer
import numpy as np
import torch

Expand Down Expand Up @@ -130,10 +130,10 @@ def __iter__(self):


def generate_text_func(
model,
tokenizer,
model: "Union[PeftModel, AutoModel]",
tokenizer: "AutoTokenizer",
producer_id: ProducerId,
eos_token: str,
eos_token: Optional[str],
text: str,
max_new_tokens: Optional[int] = 20,
min_new_tokens: Optional[int] = 0,
Expand Down

0 comments on commit eab5fcf

Please sign in to comment.