Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor ContrastiveDataset and ContrastiveDistillationDataset #579

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Next Next commit
fixed to work with processing_class instead tokenizer after transform…
…ers 4.45.2
  • Loading branch information
DemirTonchev committed Dec 20, 2024
commit cb4e803a10fab421db5b6fb24ef99f6274ade84f
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
Loading