You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/test_tipc/bigru_crf/deploy/predict.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@
28
28
parser.add_argument("--data_dir", type=str, default=None, help="The folder where the dataset is located.")
29
29
parser.add_argument("--batch_size", type=int, default=2, help="The number of sequences contained in a mini-batch.")
30
30
parser.add_argument("--max_seq_len", type=int, default=128, help="Number of words of the longest seqence.")
31
-
parser.add_argument("--device", default="gpu", type=str, choices=["cpu", "gpu"] ,help="The device to select to train the model, is must be cpu/gpu.")
31
+
parser.add_argument("--device", default="gpu", type=str, choices=["cpu", "gpu", "npu", "xpu"] ,help="The device to select to train the model, is must be cpu/gpu.")
32
32
parser.add_argument("--benchmark", type=eval, default=False, help="To log some information about environment and running.")
33
33
parser.add_argument("--save_log_path", type=str, default="./log_output/", help="The file path to save log.")
34
34
parser.add_argument('--use_tensorrt', default=False, type=eval, choices=[True, False], help='Enable to use tensorrt to speed up.')
parser.add_argument("--model_dir", type=str, default='./output', help="The path to parameters in static graph.")
251
254
parser.add_argument("--data_dir", type=str, default="./waybill_ie/data", help="The folder where the dataset is located.")
252
255
parser.add_argument("--batch_size", type=int, default=32, help="The number of sequences contained in a mini-batch.")
253
-
parser.add_argument("--device", default="gpu", type=str, choices=["cpu", "gpu"] ,help="The device to select to train the model, is must be cpu/gpu.")
256
+
parser.add_argument("--device", default="gpu", type=str, choices=["cpu", "gpu", "npu", "xpu"] ,help="The device to select to train the model, is must be cpu/gpu.")
254
257
parser.add_argument('--use_tensorrt', default=False, type=eval, choices=[True, False], help='Enable to use tensorrt to speed up.')
Copy file name to clipboardExpand all lines: tests/test_tipc/ernie_information_extraction/train.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -208,7 +208,7 @@ def do_train(args):
208
208
parser.add_argument("--save_dir", default='./checkpoint', type=str, help="The output directory where the model checkpoints will be written.")
209
209
parser.add_argument("--epochs", default=10, type=int, help="Total number of training epochs to perform.")
210
210
parser.add_argument("--batch_size", default=200, type=int, help="Batch size per GPU/CPU for training.")
211
-
parser.add_argument("--device", default="gpu", type=str, choices=["cpu", "gpu"] ,help="The device to select to train the model, is must be cpu/gpu.")
211
+
parser.add_argument("--device", default="gpu", type=str, choices=["cpu", "gpu", "npu", "xpu"] ,help="The device to select to train the model, is must be cpu/gpu.")
212
212
parser.add_argument("--seed", type=int, default=1000, help="Random seed for initialization.")
213
213
parser.add_argument("--max_steps", default=-1, type=int, help="If > 0: set total number of training steps to perform.")
214
214
parser.add_argument("--data_dir", default='./waybill_ie/data', type=str, help="The folder where the dataset is located.")
parser.add_argument("--model_dir", type=str, required=True, help="The directory to static model.")
223
223
parser.add_argument("--max_seq_length", default=128, type=int, help="The maximum total input sequence length after tokenization. Sequences longer than this will be truncated, sequences shorter will be padded.")
224
224
parser.add_argument("--batch_size", default=2, type=int, help="Batch size per GPU/CPU for training.")
225
-
parser.add_argument('--device', choices=['cpu', 'gpu', 'xpu'], default="gpu", help="Select which device to train model, defaults to gpu.")
225
+
parser.add_argument('--device', choices=['cpu', 'gpu', 'xpu', 'npu'], default="gpu", help="Select which device to train model, defaults to gpu.")
226
226
parser.add_argument('--use_tensorrt', default=False, type=eval, choices=[True, False], help='Enable to use tensorrt to speed up.')
0 commit comments