Skip to content

Commit

Permalink
fix inf1 and decoder again
Browse files Browse the repository at this point in the history
  • Loading branch information
JingyaHuang committed Aug 15, 2023
1 parent 68c50b6 commit 25ef6bc
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions optimum/neuron/modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,27 @@ def push_to_hub(
path_or_fileobj=os.path.join(os.getcwd(), local_file_path),
path_in_repo=hub_file_path,
)

def git_config_username_and_email(self, git_user: str = None, git_email: str = None):
"""
Sets git user name and email (only in the current repo)
"""
try:
if git_user is not None:
subprocess.run(
["git", "config", "--system", "user.name", git_user],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
check=True,
encoding="utf-8",
)
if git_email is not None:
subprocess.run(
["git", "config", "--system", "user.email", git_email],
stderr=subprocess.PIPE,
stdout=subprocess.PIPE,
check=True,
encoding="utf-8",
)
except subprocess.CalledProcessError as exc:
raise EnvironmentError(exc.stderr)
1 change: 1 addition & 0 deletions tests/inference/test_modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def export_model_id(request):


@pytest.fixture(scope="module")
@requires_neuronx
def neuron_model_path(export_model_id):
# For now we need to use a batch_size of 2 because it fails with batch_size == 1
model = NeuronModelForCausalLM.from_pretrained(export_model_id, export=True, batch_size=2)
Expand Down

0 comments on commit 25ef6bc

Please sign in to comment.