From f360deb6d0f9a926fe280a04863bd353598f165d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 3 Feb 2025 17:59:56 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- applications/ColossalQA/examples/webui_demo/webui.py | 4 ++-- colossalai/auto_parallel/tensor_shard/solver/solver.py | 4 ++-- colossalai/device/device_mesh.py | 4 ++-- colossalai/legacy/moe/openmoe/model/modeling_openmoe.py | 2 +- colossalai/nn/layer/layernorm.py | 4 ++-- colossalai/nn/optimizer/distributed_galore.py | 2 +- colossalai/nn/optimizer/galore.py | 2 +- colossalai/shardformer/modeling/chatglm2.py | 2 +- examples/community/roberta/preprocessing/get_mask.py | 4 ++-- examples/community/roberta/pretraining/model/deberta_v2.py | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/applications/ColossalQA/examples/webui_demo/webui.py b/applications/ColossalQA/examples/webui_demo/webui.py index 1e3433061..5ab5df99f 100644 --- a/applications/ColossalQA/examples/webui_demo/webui.py +++ b/applications/ColossalQA/examples/webui_demo/webui.py @@ -81,11 +81,11 @@ with gr.Blocks(css=CSS) as demo: ) with gr.Row(): btn = gr.UploadButton("📁", file_types=["file"], file_count="multiple", size="sm") - restart_btn = gr.Button(str("\u21BB"), elem_id="restart-btn", scale=1) + restart_btn = gr.Button(str("\u21bb"), elem_id="restart-btn", scale=1) txt = gr.Textbox( scale=8, show_label=False, - placeholder="Enter text and press enter, or use 📁 to upload files, click \u21BB to clear loaded files and restart chat", + placeholder="Enter text and press enter, or use 📁 to upload files, click \u21bb to clear loaded files and restart chat", container=True, autofocus=True, ) diff --git a/colossalai/auto_parallel/tensor_shard/solver/solver.py b/colossalai/auto_parallel/tensor_shard/solver/solver.py index 088d1acb5..447a4028e 100644 --- a/colossalai/auto_parallel/tensor_shard/solver/solver.py +++ b/colossalai/auto_parallel/tensor_shard/solver/solver.py @@ -1,6 +1,6 @@ """This code is adapted from Alpa - https://github.com/alpa-projects/alpa/ - with some changes. """ + https://github.com/alpa-projects/alpa/ +with some changes.""" import multiprocessing import time diff --git a/colossalai/device/device_mesh.py b/colossalai/device/device_mesh.py index 171d88762..a88093182 100644 --- a/colossalai/device/device_mesh.py +++ b/colossalai/device/device_mesh.py @@ -1,6 +1,6 @@ """This code is adapted from Alpa - https://github.com/alpa-projects/alpa/ - with some changes. """ + https://github.com/alpa-projects/alpa/ +with some changes.""" import operator from dataclasses import dataclass diff --git a/colossalai/legacy/moe/openmoe/model/modeling_openmoe.py b/colossalai/legacy/moe/openmoe/model/modeling_openmoe.py index 5d6e91765..c61b6848d 100644 --- a/colossalai/legacy/moe/openmoe/model/modeling_openmoe.py +++ b/colossalai/legacy/moe/openmoe/model/modeling_openmoe.py @@ -17,7 +17,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch OpenMoE model.""" +"""PyTorch OpenMoE model.""" import math from typing import List, Optional, Tuple, Union diff --git a/colossalai/nn/layer/layernorm.py b/colossalai/nn/layer/layernorm.py index 1db48faee..5b258ca3e 100644 --- a/colossalai/nn/layer/layernorm.py +++ b/colossalai/nn/layer/layernorm.py @@ -1,6 +1,6 @@ """This code is from NVIDIA apex: - https://github.com/NVIDIA/apex - with some changes. """ + https://github.com/NVIDIA/apex +with some changes.""" import numbers diff --git a/colossalai/nn/optimizer/distributed_galore.py b/colossalai/nn/optimizer/distributed_galore.py index edd119c7f..8c9745255 100644 --- a/colossalai/nn/optimizer/distributed_galore.py +++ b/colossalai/nn/optimizer/distributed_galore.py @@ -1,4 +1,4 @@ -""" adapted from https://github.com/jiaweizzhao/GaLore/blob/master/galore_torch/adamw8bit.py""" +"""adapted from https://github.com/jiaweizzhao/GaLore/blob/master/galore_torch/adamw8bit.py""" import warnings from collections import defaultdict diff --git a/colossalai/nn/optimizer/galore.py b/colossalai/nn/optimizer/galore.py index 7db97605d..c5e191e6a 100644 --- a/colossalai/nn/optimizer/galore.py +++ b/colossalai/nn/optimizer/galore.py @@ -1,4 +1,4 @@ -""" adapted from https://github.com/jiaweizzhao/GaLore/blob/master/galore_torch/adamw8bit.py""" +"""adapted from https://github.com/jiaweizzhao/GaLore/blob/master/galore_torch/adamw8bit.py""" import warnings from typing import List diff --git a/colossalai/shardformer/modeling/chatglm2.py b/colossalai/shardformer/modeling/chatglm2.py index be13200b5..50dc318bd 100644 --- a/colossalai/shardformer/modeling/chatglm2.py +++ b/colossalai/shardformer/modeling/chatglm2.py @@ -1,4 +1,4 @@ -""" PyTorch ChatGLM model. """ +"""PyTorch ChatGLM model.""" from typing import List, Optional, Tuple diff --git a/examples/community/roberta/preprocessing/get_mask.py b/examples/community/roberta/preprocessing/get_mask.py index f0ba8fe38..0a8991dd8 100644 --- a/examples/community/roberta/preprocessing/get_mask.py +++ b/examples/community/roberta/preprocessing/get_mask.py @@ -34,8 +34,8 @@ class PreTrainingDataset: self.do_whole_word_mask = do_whole_word_mask self.max_predictions_per_seq = max_predictions_per_seq self.vocab_words = list(tokenizer.vocab.keys()) - self.rec = re.compile("[\u4E00-\u9FA5]") - self.whole_rec = re.compile("##[\u4E00-\u9FA5]") + self.rec = re.compile("[\u4e00-\u9fa5]") + self.whole_rec = re.compile("##[\u4e00-\u9fa5]") self.mlm_p = 0.15 self.mlm_mask_p = 0.8 diff --git a/examples/community/roberta/pretraining/model/deberta_v2.py b/examples/community/roberta/pretraining/model/deberta_v2.py index c7457942e..e3871964c 100644 --- a/examples/community/roberta/pretraining/model/deberta_v2.py +++ b/examples/community/roberta/pretraining/model/deberta_v2.py @@ -12,7 +12,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" PyTorch DeBERTa-v2 model.""" +"""PyTorch DeBERTa-v2 model.""" import math from collections.abc import Sequence