Skip to content

Commit 9b89f45

Browse files
authored
[BUG] fix to_static (#8194)
* fix * 限制huggingface hub版本
1 parent 2900f78 commit 9b89f45

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

model_zoo/bert/run_pretrain_trainer.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class ModelArguments:
6060
default=80, metadata={"help": "The maximum total of masked tokens in input sequence"}
6161
)
6262

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

234233
# decorate @to_static for benchmark, skip it by default.
235-
if model_args.to_static:
234+
if training_args.to_static:
236235
specs = create_input_specs()
237236
model = paddle.jit.to_static(model, input_spec=specs)
238237
logger.info("Successfully to apply @to_static with specs: {}".format(specs))

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ ray
2727
loguru
2828
data
2929
wget
30+
huggingface_hub>=0.19.2

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ datasets >= 2.0.0
88
tqdm
99
paddlefsl
1010
sentencepiece
11-
huggingface_hub>=0.11.1
11+
huggingface_hub>=0.19.2
1212
onnx>=1.10.0
1313
protobuf>=3.20.2 ; platform_system != "Windows"
1414
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

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ ray
1515
loguru
1616
data
1717
wget
18+
huggingface_hub>=0.19.2

0 commit comments

Comments
 (0)