Skip to content

Commit

Permalink
fix(decoder): remove call to beta serialization api (#393)
Browse files Browse the repository at this point in the history
* fix(decoder): remove call to beta serialization api

* fix: style issue in notebooks
  • Loading branch information
dacorvo authored Dec 22, 2023
1 parent cd59cac commit 63aa3b7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions notebooks/text-generation/scripts/run_clm.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
from dataclasses import dataclass, field
import os

from datasets import load_from_disk
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
set_seed,
default_data_collator,
set_seed,
)
from datasets import load_from_disk
import torch
from huggingface_hub import login

from optimum.neuron import NeuronHfArgumentParser as HfArgumentParser
from optimum.neuron import NeuronTrainer as Trainer
from optimum.neuron import NeuronTrainingArguments as TrainingArguments
Expand Down
3 changes: 2 additions & 1 deletion notebooks/text-generation/scripts/utils/pack_dataset.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from itertools import chain
from functools import partial
from itertools import chain


remainder = {"input_ids": [], "attention_mask": [], "token_type_ids": []}

Expand Down
2 changes: 1 addition & 1 deletion optimum/neuron/modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _save_pretrained(self, save_directory: Union[str, Path]):

if src_compiled_path is None:
# The compiled model has never been serialized: do it now
self.model._save_compiled_artifacts(dst_compiled_path)
self.model.save(dst_compiled_path)
else:
shutil.copytree(src_compiled_path, dst_compiled_path)

Expand Down

0 comments on commit 63aa3b7

Please sign in to comment.