Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
00aa9dbc
Unverified
Commit
00aa9dbc
authored
Dec 07, 2020
by
Sylvain Gugger
Committed by
GitHub
Dec 07, 2020
Browse files
Copyright (#8970)
* Add copyright everywhere missing * Style
parent
c108d0b5
Changes
318
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
280 additions
and
1 deletion
+280
-1
src/transformers/__init__.py
src/transformers/__init__.py
+14
-0
src/transformers/activations.py
src/transformers/activations.py
+14
-0
src/transformers/activations_tf.py
src/transformers/activations_tf.py
+14
-0
src/transformers/benchmark/benchmark_utils.py
src/transformers/benchmark/benchmark_utils.py
+14
-1
src/transformers/commands/__init__.py
src/transformers/commands/__init__.py
+14
-0
src/transformers/commands/add_new_model.py
src/transformers/commands/add_new_model.py
+14
-0
src/transformers/commands/convert.py
src/transformers/commands/convert.py
+14
-0
src/transformers/commands/download.py
src/transformers/commands/download.py
+14
-0
src/transformers/commands/env.py
src/transformers/commands/env.py
+14
-0
src/transformers/commands/run.py
src/transformers/commands/run.py
+14
-0
src/transformers/commands/serving.py
src/transformers/commands/serving.py
+14
-0
src/transformers/commands/train.py
src/transformers/commands/train.py
+14
-0
src/transformers/commands/transformers_cli.py
src/transformers/commands/transformers_cli.py
+14
-0
src/transformers/commands/user.py
src/transformers/commands/user.py
+14
-0
src/transformers/convert_graph_to_onnx.py
src/transformers/convert_graph_to_onnx.py
+14
-0
src/transformers/data/__init__.py
src/transformers/data/__init__.py
+14
-0
src/transformers/data/data_collator.py
src/transformers/data/data_collator.py
+14
-0
src/transformers/data/datasets/__init__.py
src/transformers/data/datasets/__init__.py
+14
-0
src/transformers/data/datasets/glue.py
src/transformers/data/datasets/glue.py
+14
-0
src/transformers/data/datasets/language_modeling.py
src/transformers/data/datasets/language_modeling.py
+14
-0
No files found.
src/transformers/__init__.py
View file @
00aa9dbc
...
@@ -2,6 +2,20 @@
...
@@ -2,6 +2,20 @@
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
__version__
=
"4.1.0.dev0"
__version__
=
"4.1.0.dev0"
# Work around to update TensorFlow's absl.logging threshold which alters the
# Work around to update TensorFlow's absl.logging threshold which alters the
...
...
src/transformers/activations.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
math
import
math
import
torch
import
torch
...
...
src/transformers/activations_tf.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
math
import
math
import
tensorflow
as
tf
import
tensorflow
as
tf
...
...
src/transformers/benchmark/benchmark_utils.py
View file @
00aa9dbc
# This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
# This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp
# Copyright by the AllenNLP authors.
# Copyright 2020 The HuggingFace Team and the AllenNLP authors. All rights reserved.
#
# 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.
"""
"""
Utilities for working with the local dataset cache.
Utilities for working with the local dataset cache.
"""
"""
...
...
src/transformers/commands/__init__.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
abc
import
ABC
,
abstractmethod
from
abc
import
ABC
,
abstractmethod
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
...
...
src/transformers/commands/add_new_model.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
json
import
json
import
os
import
os
import
shutil
import
shutil
...
...
src/transformers/commands/convert.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
argparse
import
ArgumentParser
,
Namespace
from
argparse
import
ArgumentParser
,
Namespace
from
transformers.commands
import
BaseTransformersCLICommand
from
transformers.commands
import
BaseTransformersCLICommand
...
...
src/transformers/commands/download.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
from
transformers.commands
import
BaseTransformersCLICommand
from
transformers.commands
import
BaseTransformersCLICommand
...
...
src/transformers/commands/env.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
platform
import
platform
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
...
...
src/transformers/commands/run.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
from
transformers.commands
import
BaseTransformersCLICommand
from
transformers.commands
import
BaseTransformersCLICommand
...
...
src/transformers/commands/serving.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
argparse
import
ArgumentParser
,
Namespace
from
argparse
import
ArgumentParser
,
Namespace
from
typing
import
Any
,
List
,
Optional
from
typing
import
Any
,
List
,
Optional
...
...
src/transformers/commands/train.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
os
import
os
from
argparse
import
ArgumentParser
,
Namespace
from
argparse
import
ArgumentParser
,
Namespace
...
...
src/transformers/commands/transformers_cli.py
View file @
00aa9dbc
#!/usr/bin/env python
#!/usr/bin/env python
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
from
transformers.commands.add_new_model
import
AddNewModelCommand
from
transformers.commands.add_new_model
import
AddNewModelCommand
...
...
src/transformers/commands/user.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
os
import
os
import
subprocess
import
subprocess
import
sys
import
sys
...
...
src/transformers/convert_graph_to_onnx.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
argparse
import
ArgumentParser
from
argparse
import
ArgumentParser
from
os
import
listdir
,
makedirs
from
os
import
listdir
,
makedirs
from
pathlib
import
Path
from
pathlib
import
Path
...
...
src/transformers/data/__init__.py
View file @
00aa9dbc
...
@@ -2,6 +2,20 @@
...
@@ -2,6 +2,20 @@
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
.metrics
import
glue_compute_metrics
,
xnli_compute_metrics
from
.metrics
import
glue_compute_metrics
,
xnli_compute_metrics
from
.processors
import
(
from
.processors
import
(
DataProcessor
,
DataProcessor
,
...
...
src/transformers/data/data_collator.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
random
import
random
import
warnings
import
warnings
from
dataclasses
import
dataclass
from
dataclasses
import
dataclass
...
...
src/transformers/data/datasets/__init__.py
View file @
00aa9dbc
...
@@ -2,6 +2,20 @@
...
@@ -2,6 +2,20 @@
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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.
from
.glue
import
GlueDataset
,
GlueDataTrainingArguments
from
.glue
import
GlueDataset
,
GlueDataTrainingArguments
from
.language_modeling
import
(
from
.language_modeling
import
(
LineByLineTextDataset
,
LineByLineTextDataset
,
...
...
src/transformers/data/datasets/glue.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
os
import
os
import
time
import
time
import
warnings
import
warnings
...
...
src/transformers/data/datasets/language_modeling.py
View file @
00aa9dbc
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# 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
json
import
json
import
os
import
os
import
pickle
import
pickle
...
...
Prev
1
2
3
4
5
6
7
8
9
10
…
16
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment