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

Add revision to push_to_hub #292

Merged
merged 6 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
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
2 changes: 2 additions & 0 deletions optimum/neuron/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def push_to_hub(
save_directory: str,
repository_id: str,
private: Optional[bool] = None,
revision: Optional[str] = "main",
philschmid marked this conversation as resolved.
Show resolved Hide resolved
use_auth_token: Union[bool, str] = True,
endpoint: Optional[str] = None,
) -> str:
Expand Down Expand Up @@ -348,6 +349,7 @@ def push_to_hub(
repo_id=repository_id,
path_or_fileobj=os.path.join(os.getcwd(), local_file_path),
path_in_repo=hub_file_path,
revision=revision,
)

def forward(self, *args, **kwargs):
Expand Down
5 changes: 0 additions & 5 deletions optimum/neuron/trainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
import torch
from packaging import version
from transformers import PreTrainedModel, Seq2SeqTrainer, Trainer, TrainingArguments
from transformers.dependency_versions_check import dep_version_check
from transformers.integrations import is_fairscale_available
from transformers.modeling_utils import unwrap_model
from transformers.trainer import (
OPTIMIZER_NAME,
Expand Down Expand Up @@ -80,9 +78,6 @@
else:
IS_SAGEMAKER_MP_POST_1_10 = False

if is_fairscale_available():
dep_version_check("fairscale")


logger = logging.get_logger("transformers.trainer")

Expand Down
Loading