Skip to content

Commit

Permalink
[BUG] fix to_static (PaddlePaddle#8194)
Browse files Browse the repository at this point in the history
* fix

* 限制huggingface hub版本
  • Loading branch information
JunnYu authored Apr 11, 2024
1 parent 2900f78 commit 9b89f45
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
3 changes: 1 addition & 2 deletions model_zoo/bert/run_pretrain_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ class ModelArguments:
default=80, metadata={"help": "The maximum total of masked tokens in input sequence"}
)

to_static: strtobool = field(default=False, metadata={"help": "Enable training under @to_static."})
profiler_options: str = field(
default=None,
metadata={"help": "Whether to use FusedTransformerEncoderLayer to replace a TransformerEncoderLayer or not."},
Expand Down Expand Up @@ -232,7 +231,7 @@ def do_train():
train_dataset = PretrainingDataset(input_file=data_file, max_pred_length=model_args.max_predictions_per_seq)

# decorate @to_static for benchmark, skip it by default.
if model_args.to_static:
if training_args.to_static:
specs = create_input_specs()
model = paddle.jit.to_static(model, input_spec=specs)
logger.info("Successfully to apply @to_static with specs: {}".format(specs))
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ ray
loguru
data
wget
huggingface_hub>=0.19.2
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ datasets >= 2.0.0
tqdm
paddlefsl
sentencepiece
huggingface_hub>=0.11.1
huggingface_hub>=0.19.2
onnx>=1.10.0
protobuf>=3.20.2 ; platform_system != "Windows"
protobuf==3.20.2 ; platform_system == "Windows" # onnx require: protobuf<4,>=3.20.2, paddle require different version on platforms, refer to: https://github.com/PaddlePaddle/Paddle/blob/cd88156a369bbfb83d6306f89e0ae6ebd78b8040/python/requirements.txt#L3
Expand Down
1 change: 1 addition & 0 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ ray
loguru
data
wget
huggingface_hub>=0.19.2

0 comments on commit 9b89f45

Please sign in to comment.