Skip to content

Commit

Permalink
fixed to work with processing_class instead tokenizer after transform…
Browse files Browse the repository at this point in the history
…ers 4.45.2
  • Loading branch information
DemirTonchev committed Dec 20, 2024
1 parent 146c7c9 commit cb4e803
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/setfit/trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def overwritten_call_event(self, event, args, state, control, **kwargs):
model=self.setfit_model,
st_model=self.model,
st_args=args,
tokenizer=self.tokenizer,
tokenizer=self.processing_class,
optimizer=self.optimizer,
lr_scheduler=self.lr_scheduler,
train_dataloader=self.train_dataloader,
Expand Down Expand Up @@ -156,9 +156,9 @@ def _set_logs_prefix(self, logs_prefix: str) -> None:
"""
self.logs_prefix = logs_prefix

def log(self, logs: Dict[str, float]) -> None:
def log(self, logs: Dict[str, float], start_time: Optional[float] = None) -> None:
logs = {f"{self.logs_prefix}_{k}" if k == "loss" else k: v for k, v in logs.items()}
return super().log(logs)
return super().log(logs, start_time)

def evaluate(
self,
Expand Down

0 comments on commit cb4e803

Please sign in to comment.