Skip to content

MindNLP打卡训练营 #1936

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Byte-compiled / optimized / DLL files

__pycache__/
*.py[cod]
*$py.class
# C extensions
*.so

# Distribution / packaging

.Python
build/
develop-eggs/
Expand Down
14 changes: 1 addition & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.

"""
setup packpage
"""
Expand Down
19 changes: 2 additions & 17 deletions tests/engine/test_trainer.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# coding=utf-8
# Copyright 2018 the HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# 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.


import dataclasses
import gc
Expand Down Expand Up @@ -49,9 +36,7 @@
from mindnlp.utils import is_mindspore_available, logging
from mindnlp.core.serialization import safe_load_file, safe_save_file, load_checkpoint
from mindnlp.utils.testing_utils import (
# ENDPOINT_STAGING,
# TOKEN,
# USER,

CaptureLogger,
LoggingLevel,
TestCasePlus,
Expand Down
4 changes: 2 additions & 2 deletions tools/auto_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ def generate_global_variables(file_path):
new_lines = lines[:]
offset = 0
for func_name, line_no in sorted(function_positions.items(), key=lambda x: x[1]):
# Test if the function exists in mindspore.mint

if hasattr(mindspore.mint, func_name):
# Insert global variable if not already present

variable_declaration = f"has_{func_name} = hasattr(mindspore.mint, '{func_name}')"
if variable_declaration not in existing_globals:
new_lines.insert(line_no + offset, variable_declaration + "\n")
Expand Down