Skip to content

Commit e8a19d3

Browse files
authored
Fix typos (#10483)
1 parent 3a23130 commit e8a19d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+89
-89
lines changed

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ PaddleNLP 使用 [Git 分支模型](http://nvie.com/posts/a-successful-git-branc
7272
类似于以下内容:
7373

7474
```text
75-
➜ (my-virtual-env) git commit -m "commiting my cool feature"
75+
➜ (my-virtual-env) git commit -m "committing my cool feature"
7676
black....................................................................Passed
7777
isort....................................................................Passed
7878
flake8...................................................................Passed
@@ -91,7 +91,7 @@ PaddleNLP 使用 [Git 分支模型](http://nvie.com/posts/a-successful-git-branc
9191
但大多数时候事情并没有那么顺利。当您的代码或文档不符合标准时,`pre-commit` 检查将失败。
9292

9393
```text
94-
➜ (my-virtual-env) git commit -m "commiting my cool feature"
94+
➜ (my-virtual-env) git commit -m "committing my cool feature"
9595
black....................................................................Passed
9696
isort....................................................................Failed
9797
- hook id: isort

csrc/gpu/moe/fused_moe/cutlass_kernels/moe_gemm/fused_moe_gemm_kernels_template.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ void MoeGemmRunner<T, WeightType>::run_gemm<EpilogueTag>(
725725
gemmConfigManager.addBestConfig(gemmId, profile_total_rows, best_config);
726726
chosen_config = best_config;
727727
} else {
728-
PADDLE_FATAL("[MoE Configure Search] find no one avaliable config.");
728+
PADDLE_FATAL("[MoE Configure Search] find no one available config.");
729729
}
730730
}
731731
dispatch_to_arch<EpilogueTag>(A,

paddlenlp/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
logger.warning(
3737
"Detected that datasets module was imported before paddlenlp. "
38-
"This may cause PaddleNLP datasets to be unavalible in intranet. "
38+
"This may cause PaddleNLP datasets to be unavailable in intranet. "
3939
"Please import paddlenlp before datasets module to avoid download issues"
4040
)
4141
import paddle

paddlenlp/dataaug/char.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def _augment_single(self, seq_tokens, aug_indexes):
436436
return sentences
437437

438438
def _generate_sequence(self, output_seq_tokens, aug_tokens, p):
439-
"""Genearte the sequences according to the mapping list"""
439+
"""Generate the sequences according to the mapping list"""
440440
for aug_token in aug_tokens:
441441
idx, token = aug_token
442442
if p == 0:

paddlenlp/dataaug/sentence.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
class SentenceGenerate:
3434
"""
3535
SentenceGenerate is a sentence-level data augmentation strategy
36-
that generates simialr sentences according to the input sequence.
37-
The strattegy first generates several sentences, and then chooses
38-
the top n simialr sentences by the model.
36+
that generates similar sentences according to the input sequence.
37+
The strategy first generates several sentences, and then chooses
38+
the top n similar sentences by the model.
3939
4040
Args:
4141
model_name (str):
@@ -82,7 +82,7 @@ def augment(self, sequences):
8282

8383
@paddle.no_grad()
8484
def _generate_similar_sentence(self, sequence, model, tokenizer):
85-
"""Generates generate_n similar sentences from the provided sequence, and chooose the best create_n similar sentences."""
85+
"""Generates generate_n similar sentences from the provided sequence, and choose the best create_n similar sentences."""
8686

8787
# Generate generate_n similar sentences
8888
generated_sequences = [sequence]
@@ -134,7 +134,7 @@ class SentenceSummarize:
134134
token probabilities in the "sampling" strategy. Default to 1.0,
135135
which means no effect.
136136
use_fp16_decoding: (bool): Whether to use fp16 for decoding.
137-
Only works when faster entry is avalible. Default to False.
137+
Only works when faster entry is available. Default to False.
138138
kwargs (dict): Additional keyword arguments refer to ..taskflow.text_summarization.TextSummarization
139139
"""
140140

@@ -337,8 +337,8 @@ def _translate(self, model, tokenizer, sequences, lang):
337337
class SentenceBackTranslateAPI:
338338
"""
339339
SentenceBackTranslateAPI is a sentence-level data augmentation strategy
340-
that translates the input sequence into one langugage, and backtranslate
341-
back into the sourche language by baidu translate api.
340+
that translates the input sequence into one language, and back-translate
341+
back into the source language by baidu translate api.
342342
343343
Args:
344344
src_lang (str):

paddlenlp/dataaug/word.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def _load_substitute_dict(self, source_type):
170170
return substitute_dict
171171

172172
def _generate_sequence(self, output_seq_tokens, aug_tokens):
173-
"""Genearte the sequences according to the mapping list"""
173+
"""Generate the sequences according to the mapping list"""
174174
for aug_token in aug_tokens:
175175
idx, token = aug_token
176176
output_seq_tokens[int(idx)] = token
@@ -503,7 +503,7 @@ def _augment_single(self, seq_tokens, aug_indexes):
503503
return sentences
504504

505505
def _generate_sequence(self, output_seq_tokens, aug_tokens, p):
506-
"""Genearte the sequences according to the mapping list"""
506+
"""Generate the sequences according to the mapping list"""
507507
for aug_token in aug_tokens:
508508
idx, token = aug_token
509509
if p == 0:

paddlenlp/experimental/autonlp/README_en.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ Args:
5050
- text_column (string, required): Name of the column that contains the input text.
5151
- label_column (string, required): Name of the column that contains the target variable to predict.
5252
- language (string, required): language of the text
53-
- metric_for_best_model (string, optional): the name of the metrc for selecting the best model.
54-
- greater_is_better (bool, optional): Whether better models should have a greater metric or not. Use in conjuction with `metric_for_best_model`.
53+
- metric_for_best_model (string, optional): the name of the metric for selecting the best model.
54+
- greater_is_better (bool, optional): Whether better models should have a greater metric or not. Use in conjunction with `metric_for_best_model`.
5555
- problem_type (str, optional): Select among ["multi_class", "multi_label"] based on the nature of your problem
5656
- output_dir (str, optional): Output directory for the experiments, defaults to "autpnlp_results"
5757
- verbosity: (int, optional): controls the verbosity of the run. Defaults to 1, which let the workers log to the driver.To reduce the amount of logs, use verbosity > 0 to set stop the workers from logging to the driver.

paddlenlp/experimental/autonlp/auto_trainer_base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class AutoTrainerBase(metaclass=ABCMeta):
4545
eval_dataset (Dataset, required): Evaluation dataset, must contains the 'text_column' and 'label_column' specified below
4646
language (string, required): language of the text
4747
metric_for_best_model (string, optional): the name of the metric for selecting the best model.
48-
greater_is_better (bool, required): Whether better models should have a greater metric or not. Use in conjuction with `metric_for_best_model`.
48+
greater_is_better (bool, required): Whether better models should have a greater metric or not. Use in conjunction with `metric_for_best_model`.
4949
output_dir (str, optional): Output directory for the experiments, defaults to "autpnlp_results"
5050
verbosity: (int, optional): controls the verbosity of the run. Defaults to 1, which let the workers log to the driver.To reduce the amount of logs,
5151
use verbosity > 0 to set stop the workers from logging to the driver.

paddlenlp/experimental/autonlp/text_classification.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ class AutoTrainerForTextClassification(AutoTrainerBase):
5959
eval_dataset (Dataset, required): Evaluation dataset, must contains the 'text_column' and 'label_column' specified below
6060
text_column (string, required): Name of the column that contains the input text.
6161
label_column (string, required): Name of the column that contains the target variable to predict.
62-
metric_for_best_model (string, optional): the name of the metrc for selecting the best model. Default to 'eval_accuracy'.
63-
greater_is_better (bool, optional): Whether better models should have a greater metric or not. Use in conjuction with `metric_for_best_model`.
62+
metric_for_best_model (string, optional): the name of the metric for selecting the best model. Default to 'eval_accuracy'.
63+
greater_is_better (bool, optional): Whether better models should have a greater metric or not. Use in conjunction with `metric_for_best_model`.
6464
problem_type (str, optional): Select among ["multi_class", "multi_label"] based on the nature of your problem
6565
kwargs (dict, optional): Additional keyword arguments passed along to the specific task.
6666
language (string, required): language of the text.
@@ -639,7 +639,7 @@ def export(self, export_path: str, trial_id: Optional[str] = None, compress: boo
639639
f"Taskflow config saved to {export_path}. You can use the Taskflow config to create a Taskflow instance for inference"
640640
)
641641

642-
logger.info(f"Exported trial_id: {trial_id} to export_path: {export_path} sucessfully!")
642+
logger.info(f"Exported trial_id: {trial_id} to export_path: {export_path} successfully!")
643643

644644
if os.path.exists(self.training_path):
645645
logger.info("Removing training checkpoints to conserve disk space")

paddlenlp/experimental/faster_tokenizer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
def to_tensor(string_values, name="text"):
3030
"""
3131
Create the tensor that the value holds the list of string.
32-
NOTICE: The value will be holded in the cpu place.
32+
NOTICE: The value will be held in the cpu place.
3333
3434
Args:
35-
string_values(list[string]): The value will be setted to the tensor.
35+
string_values(list[string]): The value will be set to the tensor.
3636
name(string): The name of the tensor.
3737
"""
3838
tensor = paddle.Tensor(core.VarDesc.VarType.STRING, [], name, core.VarDesc.VarType.STRINGS, False)
@@ -43,7 +43,7 @@ def to_tensor(string_values, name="text"):
4343
def to_vocab_buffer(vocab_dict, name):
4444
"""
4545
Create the tensor that the value holds the map, the type of key is the string.
46-
NOTICE: The value will be holded in the cpu place.
46+
NOTICE: The value will be held in the cpu place.
4747
4848
Args:
4949
vocab_dict(dict): The value will be setted to the tensor.

paddlenlp/experimental/transformers/bloom/modeling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ def set_state_dict(self, state_dict, use_structured_name=True):
392392
elif k.endswith("mlp.dense_4h_to_h.bias"):
393393
self.transformer_block.ffn2_biases[idx].set_value(paddle.to_tensor(v))
394394
else:
395-
raise ValueError("Unknow weight {}".format(k))
395+
raise ValueError("Unknown weight {}".format(k))
396396

397397

398398
class BloomLMHead(nn.Layer):

paddlenlp/experimental/transformers/chatglm/modeling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ def set_state_dict(self, state_dict, use_structured_name=True):
481481
elif k.endswith("mlp.dense_4h_to_h.bias"):
482482
self.transformer_block.ffn2_biases[idx].set_value(v.astype(dtype))
483483
else:
484-
print("Unknow weight {}".format(k))
484+
print("Unknown weight {}".format(k))
485485

486486

487487
@register_base_model

paddlenlp/experimental/transformers/deepseek_v2/modeling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def forward(
145145

146146
class DeepseekScalingRotaryEmbeddingXPU(nn.Layer):
147147
"""
148-
RotaryEmbedding XPU Implemention. In XPU, cos and sin must be computed in cpu.
148+
RotaryEmbedding XPU Implementation. In XPU, cos and sin must be computed in cpu.
149149
"""
150150

151151
def __init__(

paddlenlp/experimental/transformers/generation_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def to_static(self, output_path: str, config: dict):
102102
config.get("logits_processors", None),
103103
precache_input_spec,
104104
]
105-
# use "==" to distingusih between chatglm and chatglm_v2.
105+
# use "==" to distinguish between chatglm and chatglm_v2.
106106
if self.config["model_type"] and "chatglm" == self.config.model_type.lower():
107107
input_spec[2] = paddle.static.InputSpec(
108108
shape=[None, None, None], dtype="int64", name="position_ids"

paddlenlp/experimental/transformers/gpt/modeling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ def set_state_dict(self, state_dict):
432432
elif k.endswith("linear2.bias"):
433433
self.transformer_block.ffn2_biases[idx].set_value(v.astype(dtype))
434434
else:
435-
raise ValueError("Unknow weight {}".format(k))
435+
raise ValueError("Unknown weight {}".format(k))
436436

437437

438438
class GPTForCausalLMInferenceModel(GenerationInferenceModel, GPTPretrainedModel):

paddlenlp/generation/configuration_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class GenerationConfig:
121121
use_fast: (bool, optional): Whether to use fast entry of model
122122
for FastGeneration. Default to False.
123123
use_fp16_decoding: (bool, optional): Whether to use fp16 for decoding.
124-
Only works when fast entry is avalible. Default to False.
124+
Only works when fast entry is available. Default to False.
125125
trunc_input: (bool, optional): Whether to truncate the inputs from
126126
output sequences . Default to True.
127127
model_kwargs (dict): It can be used to specify additional kwargs

paddlenlp/generation/streamers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ def _is_chinese_char(self, cp):
149149
class TextIteratorStreamer(TextStreamer):
150150
"""
151151
Streamer that stores print-ready text in a queue, to be used by a downstream application as an iterator. This is
152-
useful for applications that benefit from acessing the generated text in a non-blocking way (e.g. in an interactive
152+
useful for applications that benefit from accessing the generated text in a non-blocking way (e.g. in an interactive
153153
Gradio demo).
154154
155155
Parameters:

paddlenlp/generation/utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ def sample(
12231223
next_tokens = paddle.multinomial(probs)
12241224

12251225
if self.config.tensor_parallel_degree > 1:
1226-
# Maybe no need to broadcast if seed is set correclty.
1226+
# Maybe no need to broadcast if seed is set correctly.
12271227
from paddle.distributed import fleet
12281228

12291229
try:

paddlenlp/metrics/dureader.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def compute_predictions(
127127

128128
nbest.append(_NbestPrediction(text=final_text, start_logit=pred.start_logit, end_logit=pred.end_logit))
129129

130-
# if we didn't inlude the empty option in the n-best, inlcude it
130+
# if we didn't include the empty option in the n-best, include it
131131

132132
# In very rare edge cases we could have no valid predictions. So we
133133
# just create a nonce prediction in this case to avoid failure.

paddlenlp/ops/optimizer/adamwdl.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _append_optimize_op(self, block, param_and_grad):
188188
ratio = self.set_param_lr_fun(param_and_grad[0])
189189
param_and_grad[0].optimize_attr["learning_rate"] *= ratio
190190

191-
# excute Adam op
191+
# execute Adam op
192192
res = super(AdamWDL, self)._append_optimize_op(block, param_and_grad)
193193
param_and_grad[0].optimize_attr["learning_rate"] = prev_lr
194194
return res

paddlenlp/ops/triton_ops/fused_moe.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def get_default_config(
934934
"num_stages": 4,
935935
}
936936
else:
937-
# Block-wise quant: BLOCK_SIZE_K must be divisable by block_shape[1]
937+
# Block-wise quant: BLOCK_SIZE_K must be divisible by block_shape[1]
938938
config = {
939939
"BLOCK_SIZE_M": 64,
940940
"BLOCK_SIZE_N": block_shape[0],

paddlenlp/ops/triton_ops/triton_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def extract_triton_kernel(kernel, file_name):
9898
elif type(kernel) == triton.runtime.autotuner.Autotuner:
9999
fn = kernel.fn.fn
100100
else:
101-
AssertionError("error occures")
101+
AssertionError("error occurs")
102102
py_script = textwrap.dedent(inspect.getsource(fn))
103103

104104
# @triton.jit must only appear once

paddlenlp/peft/lokr/lokr_layers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def factorization(dimension: int, factor: int = -1) -> Tuple[int, int]:
196196
In LoRA with Kroneckor Product, first value is a value for weight scale.
197197
second value is a value for weight.
198198
199-
Becuase of non-commutative property, A⊗B ≠ B⊗A. Meaning of two matrices is slightly different.
199+
Because of non-commutative property, A⊗B ≠ B⊗A. Meaning of two matrices is slightly different.
200200
201201
examples)
202202
factor

paddlenlp/peft/lora/auto_lora_model.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def save_pretrained(self, save_directory: str, merge_tensor_parallel: bool = Fal
318318
if self.is_pipelinemodel and merge_tensor_parallel and self.lora_config.tensor_parallel_degree > 1:
319319
merge_tensor_parallel = False
320320
logger.warning(
321-
"Pipeline parallism does not support merge_tensor_parallel. Set merge_tensor_parallel to False."
321+
"Pipeline parallelism does not support merge_tensor_parallel. Set merge_tensor_parallel to False."
322322
)
323323

324324
variant = kwargs.get("variant", None)
@@ -580,7 +580,7 @@ def merge_auto_dist_configs(self, configs):
580580
for k, v in config["mp_config"]["parallelize_plan"].items():
581581
assert (
582582
k not in final_config["mp_config"]["parallelize_plan"].keys()
583-
), f"sublayer mp_config shuld be a subset of model but got sublayer config {config['mp_config']} and model config {final_config['mp_config']}."
583+
), f"sublayer mp_config should be a subset of model but got sublayer config {config['mp_config']} and model config {final_config['mp_config']}."
584584
final_config["mp_config"]["parallelize_plan"][k] = v
585585
if "sp_config" in config and config["sp_config"] is not None:
586586
if final_config["sp_config"] is None:
@@ -589,7 +589,7 @@ def merge_auto_dist_configs(self, configs):
589589
for k, v in config["sp_config"]["parallelize_plan"].items():
590590
assert (
591591
k not in final_config["sp_config"]["parallelize_plan"].keys()
592-
), f"sublayer sp_config shuld be a subset of model but got sublayer config {config['sp_config']} and model config {final_config['sp_config']}."
592+
), f"sublayer sp_config should be a subset of model but got sublayer config {config['sp_config']} and model config {final_config['sp_config']}."
593593
final_config["sp_config"]["parallelize_plan"][k] = v
594594
if "pp_config" in config and config["pp_config"] is not None:
595595

paddlenlp/peft/lora/lora_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ def save_pretrained(self, save_directory: str, merge_tensor_parallel: bool = Fal
420420
if self.is_pipelinemodel and merge_tensor_parallel and self.lora_config.tensor_parallel_degree > 1:
421421
merge_tensor_parallel = False
422422
logger.warning(
423-
"Pipeline parallism does not support merge_tensor_parallel. Set merge_tensor_parallel to False."
423+
"Pipeline parallelism does not support merge_tensor_parallel. Set merge_tensor_parallel to False."
424424
)
425425

426426
variant = kwargs.get("variant", None)

paddlenlp/peft/vera/vera_model.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def save_pretrained(self, save_directory: str, merge_tensor_parallel: bool = Fal
111111
if self.is_pipelinemodel and merge_tensor_parallel and self.vera_config.tensor_parallel_degree > 1:
112112
merge_tensor_parallel = False
113113
logger.warning(
114-
"Pipeline parallism does not support merge_tensor_parallel. Set merge_tensor_parallel to False."
114+
"Pipeline parallelism does not support merge_tensor_parallel. Set merge_tensor_parallel to False."
115115
)
116116

117117
variant = kwargs.get("variant", None)

paddlenlp/prompt/template.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ def parse_soft_prompt(self):
503503
continuous token id sequence for each part in template.
504504
505505
Returns:
506-
`List[Dict[str, str]]`: Template with continuous prompt formated as {"soft": "xxx"}.
506+
`List[Dict[str, str]]`: Template with continuous prompt formatted as {"soft": "xxx"}.
507507
`Tuple[Dict[int, int], List[List[int]], int]`:
508508
- Mapping from continuous ids to word ids for initialization.
509509
- Continuous ids for each part. Id 0 denotes none-continuous part.

paddlenlp/rl/trainer/ppo_trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ def _balance_batch(self, micro_batches):
12081208
if dp_degree * sharding_degree == 1:
12091209
return micro_batches
12101210

1211-
# otherwise, need to balance batch accross DP and Sharding groups
1211+
# otherwise, need to balance batch across DP and Sharding groups
12121212
try:
12131213
hcg = fleet.get_hybrid_communicate_group()
12141214
sharding_parallel_group = hcg.get_sharding_parallel_group()

0 commit comments

Comments
 (0)