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

support gemma #441

Merged
merged 6 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
compat with transformers==4.38
  • Loading branch information
Jintao-Huang committed Feb 22, 2024
commit 27d617bec83a03e8dc154b205cbb5df3059b3949
2 changes: 1 addition & 1 deletion requirements/framework.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ rouge
safetensors
tensorboard
tqdm
transformers>=4.33,<4.38
transformers>=4.33,<4.39
trl>=0.7.7
8 changes: 3 additions & 5 deletions swift/trainers/mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def _add_patterns_to_gitattributes(

def init_hf_repo(self) -> None:
"""init ms repo. Compatible with transformers>=4.34"""
self.init_git_repo()
self.init_git_repo(at_init=True)

def init_git_repo(self, at_init: bool = False) -> None:
if not self.is_world_process_zero():
Expand Down Expand Up @@ -578,8 +578,7 @@ def _load_best_model(self):
except ValueError as e:
logger.warning(e)

def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch,
ignore_keys_for_eval):
def _maybe_log_save_evaluate(self, tr_loss, *args, **kwargs):
if self.control.should_log:
self.control.should_log = False
logs: Dict[str, float] = {}
Expand All @@ -601,5 +600,4 @@ def _maybe_log_save_evaluate(self, tr_loss, model, trial, epoch,
self._globalstep_last_logged = self.state.global_step
self.store_flos()
self.log(logs)
super()._maybe_log_save_evaluate(tr_loss, model, trial, epoch,
ignore_keys_for_eval)
super()._maybe_log_save_evaluate(tr_loss, *args, **kwargs)
Loading