diff --git a/Makefile b/Makefile index 1f8c64ae1..2e260c8bf 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/__init__.py b/optimum/graphcore/__init__.py index f35767d3b..7dc962764 100644 --- a/optimum/graphcore/__init__.py +++ b/optimum/graphcore/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/data/data_collator.py b/optimum/graphcore/data/data_collator.py index 8bb0482be..9ad340333 100644 --- a/optimum/graphcore/data/data_collator.py +++ b/optimum/graphcore/data/data_collator.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/diffusers/__init__.py b/optimum/graphcore/diffusers/__init__.py index 1c4e1b2b7..68d320842 100644 --- a/optimum/graphcore/diffusers/__init__.py +++ b/optimum/graphcore/diffusers/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 .pipelines import ( INFERENCE_ENGINES_TO_MODEL_NAMES, IPUStableDiffusionImg2ImgPipeline, diff --git a/optimum/graphcore/diffusers/pipelines/__init__.py b/optimum/graphcore/diffusers/pipelines/__init__.py index 54e346ebb..25991dc98 100644 --- a/optimum/graphcore/diffusers/pipelines/__init__.py +++ b/optimum/graphcore/diffusers/pipelines/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 .stable_diffusion import ( INFERENCE_ENGINES_TO_MODEL_NAMES, IPUStableDiffusionImg2ImgPipeline, diff --git a/optimum/graphcore/diffusers/pipelines/stable_diffusion/__init__.py b/optimum/graphcore/diffusers/pipelines/stable_diffusion/__init__.py index b3dabe637..2119a85ae 100644 --- a/optimum/graphcore/diffusers/pipelines/stable_diffusion/__init__.py +++ b/optimum/graphcore/diffusers/pipelines/stable_diffusion/__init__.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 .ipu_configs import INFERENCE_ENGINES_TO_MODEL_NAMES, get_default_ipu_configs from .pipeline_stable_diffusion import IPUStableDiffusionPipeline from .pipeline_stable_diffusion_img2img import IPUStableDiffusionImg2ImgPipeline diff --git a/optimum/graphcore/diffusers/pipelines/stable_diffusion/ipu_configs.py b/optimum/graphcore/diffusers/pipelines/stable_diffusion/ipu_configs.py index e210f6679..0e8811832 100644 --- a/optimum/graphcore/diffusers/pipelines/stable_diffusion/ipu_configs.py +++ b/optimum/graphcore/diffusers/pipelines/stable_diffusion/ipu_configs.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 typing import Any, Dict from optimum.utils import logging diff --git a/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py b/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py index e7b196807..afdca6e51 100644 --- a/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py +++ b/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 diffusers import StableDiffusionPipeline from .pipeline_stable_diffusion_mixin import IPUStableDiffusionPipelineMixin diff --git a/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py b/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py index bda0e888d..50efe0100 100644 --- a/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py +++ b/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_img2img.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 diffusers import StableDiffusionImg2ImgPipeline from .pipeline_stable_diffusion_mixin import IPUStableDiffusionPipelineMixin diff --git a/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py b/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py index 700ab4ace..7c7cc4341 100644 --- a/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py +++ b/optimum/graphcore/diffusers/pipelines/stable_diffusion/pipeline_stable_diffusion_inpaint.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 diffusers import StableDiffusionInpaintPipeline from .pipeline_stable_diffusion_mixin import IPUStableDiffusionPipelineMixin diff --git a/optimum/graphcore/diffusers/pipelines/stable_diffusion/safety_checker.py b/optimum/graphcore/diffusers/pipelines/stable_diffusion/safety_checker.py index 55a480c16..abdccd2ff 100644 --- a/optimum/graphcore/diffusers/pipelines/stable_diffusion/safety_checker.py +++ b/optimum/graphcore/diffusers/pipelines/stable_diffusion/safety_checker.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 torch from diffusers.pipelines.stable_diffusion.safety_checker import StableDiffusionSafetyChecker, cosine_distance diff --git a/optimum/graphcore/generation/utils.py b/optimum/graphcore/generation/utils.py index b5424cd28..56ac70a39 100644 --- a/optimum/graphcore/generation/utils.py +++ b/optimum/graphcore/generation/utils.py @@ -1,4 +1,5 @@ # Copyright 2022 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/ipu_configuration.py b/optimum/graphcore/ipu_configuration.py index c236e0ebe..34fd275cf 100644 --- a/optimum/graphcore/ipu_configuration.py +++ b/optimum/graphcore/ipu_configuration.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/modeling_utils.py b/optimum/graphcore/modeling_utils.py index 705dec332..a1574c5f9 100644 --- a/optimum/graphcore/modeling_utils.py +++ b/optimum/graphcore/modeling_utils.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/__init__.py b/optimum/graphcore/models/__init__.py index b90e25962..b80a974eb 100644 --- a/optimum/graphcore/models/__init__.py +++ b/optimum/graphcore/models/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2021 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/bart/__init__.py b/optimum/graphcore/models/bart/__init__.py index 71144cc8f..554e34a6e 100644 --- a/optimum/graphcore/models/bart/__init__.py +++ b/optimum/graphcore/models/bart/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/bart/modeling_bart.py b/optimum/graphcore/models/bart/modeling_bart.py index 3482b6565..c663091a7 100644 --- a/optimum/graphcore/models/bart/modeling_bart.py +++ b/optimum/graphcore/models/bart/modeling_bart.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/bert/__init__.py b/optimum/graphcore/models/bert/__init__.py index 615d14b79..70363ad9b 100644 --- a/optimum/graphcore/models/bert/__init__.py +++ b/optimum/graphcore/models/bert/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/bert/modeling_bert.py b/optimum/graphcore/models/bert/modeling_bert.py index a40ba9918..7a1230a4c 100644 --- a/optimum/graphcore/models/bert/modeling_bert.py +++ b/optimum/graphcore/models/bert/modeling_bert.py @@ -1,3 +1,5 @@ +# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. +# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2021 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/convnext/__init__.py b/optimum/graphcore/models/convnext/__init__.py index cf67b8ee4..d5316d247 100644 --- a/optimum/graphcore/models/convnext/__init__.py +++ b/optimum/graphcore/models/convnext/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/convnext/modeling_convnext.py b/optimum/graphcore/models/convnext/modeling_convnext.py index 96c175c2a..a7713d86a 100644 --- a/optimum/graphcore/models/convnext/modeling_convnext.py +++ b/optimum/graphcore/models/convnext/modeling_convnext.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Graphcore Ltd. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/convnext/optimized_convnextlayer.py b/optimum/graphcore/models/convnext/optimized_convnextlayer.py index 78e6a0e18..d73fdee7d 100644 --- a/optimum/graphcore/models/convnext/optimized_convnextlayer.py +++ b/optimum/graphcore/models/convnext/optimized_convnextlayer.py @@ -1,3 +1,18 @@ +# Copyright 2022 Meta Platforms, Inc. and The HuggingFace Inc. team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 transformers.models.convnext.modeling_convnext import ConvNextLayer diff --git a/optimum/graphcore/models/deberta/__init__.py b/optimum/graphcore/models/deberta/__init__.py index 49e61d473..773a23f0d 100644 --- a/optimum/graphcore/models/deberta/__init__.py +++ b/optimum/graphcore/models/deberta/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/deberta/modeling_deberta.py b/optimum/graphcore/models/deberta/modeling_deberta.py index 32bdd0ce5..4983a1bd4 100644 --- a/optimum/graphcore/models/deberta/modeling_deberta.py +++ b/optimum/graphcore/models/deberta/modeling_deberta.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Graphcore Ltd. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/distilbert/__init__.py b/optimum/graphcore/models/distilbert/__init__.py index 46e7b9cdd..da4127dc3 100644 --- a/optimum/graphcore/models/distilbert/__init__.py +++ b/optimum/graphcore/models/distilbert/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/distilbert/modeling_distilbert.py b/optimum/graphcore/models/distilbert/modeling_distilbert.py index 66f6a50cf..f921d593f 100644 --- a/optimum/graphcore/models/distilbert/modeling_distilbert.py +++ b/optimum/graphcore/models/distilbert/modeling_distilbert.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Graphcore Ltd. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/gpt2/__init__.py b/optimum/graphcore/models/gpt2/__init__.py index 23e4e8d47..3a198e235 100644 --- a/optimum/graphcore/models/gpt2/__init__.py +++ b/optimum/graphcore/models/gpt2/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/gpt2/modeling_gpt2.py b/optimum/graphcore/models/gpt2/modeling_gpt2.py index 0237acec1..b08c25ced 100644 --- a/optimum/graphcore/models/gpt2/modeling_gpt2.py +++ b/optimum/graphcore/models/gpt2/modeling_gpt2.py @@ -1,4 +1,4 @@ -# Copyright (c) 2021 Graphcore Ltd. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/gpt2/optimized_gpt2_attn.py b/optimum/graphcore/models/gpt2/optimized_gpt2_attn.py index b27fc1e8e..350ac1e3f 100644 --- a/optimum/graphcore/models/gpt2/optimized_gpt2_attn.py +++ b/optimum/graphcore/models/gpt2/optimized_gpt2_attn.py @@ -1,3 +1,19 @@ +# Copyright 2018 The OpenAI Team Authors and HuggingFace Inc. team. +# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 torch import torch.nn as nn from transformers.models.gpt2.modeling_gpt2 import GPT2Attention diff --git a/optimum/graphcore/models/groupbert/__init__.py b/optimum/graphcore/models/groupbert/__init__.py index 7a253a1b8..1fa61cf61 100644 --- a/optimum/graphcore/models/groupbert/__init__.py +++ b/optimum/graphcore/models/groupbert/__init__.py @@ -2,7 +2,7 @@ # 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. -# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/groupbert/modeling_groupbert.py b/optimum/graphcore/models/groupbert/modeling_groupbert.py index 1a327d907..798867eff 100644 --- a/optimum/graphcore/models/groupbert/modeling_groupbert.py +++ b/optimum/graphcore/models/groupbert/modeling_groupbert.py @@ -1,5 +1,4 @@ -# /usr/bin/python3 -# Copyright (c) 2021 Graphcore Ltd. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/hubert/__init__.py b/optimum/graphcore/models/hubert/__init__.py index 941703316..60cde2092 100644 --- a/optimum/graphcore/models/hubert/__init__.py +++ b/optimum/graphcore/models/hubert/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/hubert/ipu_layer_drop.py b/optimum/graphcore/models/hubert/ipu_layer_drop.py index c41150696..90f5afc83 100644 --- a/optimum/graphcore/models/hubert/ipu_layer_drop.py +++ b/optimum/graphcore/models/hubert/ipu_layer_drop.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/hubert/modeling_hubert.py b/optimum/graphcore/models/hubert/modeling_hubert.py index fdc4b25a9..9b3967c09 100644 --- a/optimum/graphcore/models/hubert/modeling_hubert.py +++ b/optimum/graphcore/models/hubert/modeling_hubert.py @@ -1,3 +1,4 @@ +# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. All rights reserved. # Copyright (c) 2021 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/lxmert/__init__.py b/optimum/graphcore/models/lxmert/__init__.py index be83ae5ce..182226ef4 100644 --- a/optimum/graphcore/models/lxmert/__init__.py +++ b/optimum/graphcore/models/lxmert/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/lxmert/modeling_lxmert.py b/optimum/graphcore/models/lxmert/modeling_lxmert.py index fe6243842..c3eea4d71 100644 --- a/optimum/graphcore/models/lxmert/modeling_lxmert.py +++ b/optimum/graphcore/models/lxmert/modeling_lxmert.py @@ -1,3 +1,4 @@ +# Copyright 2018 Hao Tan, Mohit Bansal, and the HuggingFace team # Copyright (c) 2021 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/mt5/__init__.py b/optimum/graphcore/models/mt5/__init__.py index 1c5eba716..6e2a069b7 100644 --- a/optimum/graphcore/models/mt5/__init__.py +++ b/optimum/graphcore/models/mt5/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/mt5/modeling_mt5.py b/optimum/graphcore/models/mt5/modeling_mt5.py index 668fb2f3c..139dd3f3b 100644 --- a/optimum/graphcore/models/mt5/modeling_mt5.py +++ b/optimum/graphcore/models/mt5/modeling_mt5.py @@ -1,4 +1,5 @@ -# Copyright 2022 The HuggingFace Team. All rights reserved. +# Copyright 2020 Mesh TensorFlow authors, T5 Authors and HuggingFace Inc. team. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/roberta/__init__.py b/optimum/graphcore/models/roberta/__init__.py index bcf41b2a8..3bd89f86f 100644 --- a/optimum/graphcore/models/roberta/__init__.py +++ b/optimum/graphcore/models/roberta/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/roberta/modeling_roberta.py b/optimum/graphcore/models/roberta/modeling_roberta.py index 22dab7596..bd378c118 100644 --- a/optimum/graphcore/models/roberta/modeling_roberta.py +++ b/optimum/graphcore/models/roberta/modeling_roberta.py @@ -1,3 +1,5 @@ +# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. +# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # Copyright (c) 2021 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/t5/__init__.py b/optimum/graphcore/models/t5/__init__.py index a3b995d21..8c1ac10a0 100644 --- a/optimum/graphcore/models/t5/__init__.py +++ b/optimum/graphcore/models/t5/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/t5/configuration_t5.py b/optimum/graphcore/models/t5/configuration_t5.py index 7a05ee260..cb66d7075 100644 --- a/optimum/graphcore/models/t5/configuration_t5.py +++ b/optimum/graphcore/models/t5/configuration_t5.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 transformers import T5Config diff --git a/optimum/graphcore/models/t5/modeling_t5.py b/optimum/graphcore/models/t5/modeling_t5.py index 7cb71daef..4b00b7603 100644 --- a/optimum/graphcore/models/t5/modeling_t5.py +++ b/optimum/graphcore/models/t5/modeling_t5.py @@ -1,4 +1,5 @@ # Copyright 2022 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/vit/__init__.py b/optimum/graphcore/models/vit/__init__.py index 7240c38a3..90a423990 100644 --- a/optimum/graphcore/models/vit/__init__.py +++ b/optimum/graphcore/models/vit/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/vit/modeling_vit.py b/optimum/graphcore/models/vit/modeling_vit.py index f9f003e54..495ed6c77 100644 --- a/optimum/graphcore/models/vit/modeling_vit.py +++ b/optimum/graphcore/models/vit/modeling_vit.py @@ -1,3 +1,4 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. # Copyright (c) 2021 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/wav2vec2/__init__.py b/optimum/graphcore/models/wav2vec2/__init__.py index b4eff9ecd..c5453f13f 100644 --- a/optimum/graphcore/models/wav2vec2/__init__.py +++ b/optimum/graphcore/models/wav2vec2/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/wav2vec2/ipu_gumbel_vector_quantizer.py b/optimum/graphcore/models/wav2vec2/ipu_gumbel_vector_quantizer.py index 04ff94dc2..87b92a746 100644 --- a/optimum/graphcore/models/wav2vec2/ipu_gumbel_vector_quantizer.py +++ b/optimum/graphcore/models/wav2vec2/ipu_gumbel_vector_quantizer.py @@ -1,3 +1,4 @@ +# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. All rights reserved. # Copyright (c) 2022 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/wav2vec2/ipu_layer_drop.py b/optimum/graphcore/models/wav2vec2/ipu_layer_drop.py index 21fbb4681..3052bf451 100644 --- a/optimum/graphcore/models/wav2vec2/ipu_layer_drop.py +++ b/optimum/graphcore/models/wav2vec2/ipu_layer_drop.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/wav2vec2/modeling_wav2vec2.py b/optimum/graphcore/models/wav2vec2/modeling_wav2vec2.py index abe7c9aca..d3a1013e3 100755 --- a/optimum/graphcore/models/wav2vec2/modeling_wav2vec2.py +++ b/optimum/graphcore/models/wav2vec2/modeling_wav2vec2.py @@ -1,3 +1,4 @@ +# Copyright 2021 The Fairseq Authors and the HuggingFace Inc. team. All rights reserved. # Copyright (c) 2022 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/whisper/__init__.py b/optimum/graphcore/models/whisper/__init__.py index 5eb3399ea..8ba9f5272 100644 --- a/optimum/graphcore/models/whisper/__init__.py +++ b/optimum/graphcore/models/whisper/__init__.py @@ -3,6 +3,7 @@ # module, but to preserve other warnings. So, don't check this module at all. # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/models/whisper/feature_extraction_whisper.py b/optimum/graphcore/models/whisper/feature_extraction_whisper.py index a7c9bf294..700bb4184 100644 --- a/optimum/graphcore/models/whisper/feature_extraction_whisper.py +++ b/optimum/graphcore/models/whisper/feature_extraction_whisper.py @@ -1,3 +1,4 @@ +# Copyright 2022 The HuggingFace Inc. team. # Copyright (c) 2023 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/models/whisper/modeling_whisper.py b/optimum/graphcore/models/whisper/modeling_whisper.py index 05460842a..1b671cb14 100644 --- a/optimum/graphcore/models/whisper/modeling_whisper.py +++ b/optimum/graphcore/models/whisper/modeling_whisper.py @@ -1,3 +1,4 @@ +# Copyright 2022 The OpenAI Authors and The HuggingFace Inc. team. All rights reserved. # Copyright (c) 2023 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/pipelines/__init__.py b/optimum/graphcore/pipelines/__init__.py index 9c721138a..1230e6ffb 100644 --- a/optimum/graphcore/pipelines/__init__.py +++ b/optimum/graphcore/pipelines/__init__.py @@ -1,3 +1,4 @@ +# Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2022 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/pipelines/automatic_speech_recognition.py b/optimum/graphcore/pipelines/automatic_speech_recognition.py index 39dc4ab4d..be2dbd677 100644 --- a/optimum/graphcore/pipelines/automatic_speech_recognition.py +++ b/optimum/graphcore/pipelines/automatic_speech_recognition.py @@ -1,3 +1,4 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. # Copyright (c) 2023 Graphcore Ltd. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/optimum/graphcore/pipelines/fill_mask.py b/optimum/graphcore/pipelines/fill_mask.py index 0f061403b..0abe9f6d8 100644 --- a/optimum/graphcore/pipelines/fill_mask.py +++ b/optimum/graphcore/pipelines/fill_mask.py @@ -1,3 +1,18 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 typing import Dict from transformers import FillMaskPipeline diff --git a/optimum/graphcore/pipelines/text2text_generation.py b/optimum/graphcore/pipelines/text2text_generation.py index b1996b69e..f996f0f4a 100644 --- a/optimum/graphcore/pipelines/text2text_generation.py +++ b/optimum/graphcore/pipelines/text2text_generation.py @@ -1,3 +1,18 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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 transformers import SummarizationPipeline, Text2TextGenerationPipeline, TranslationPipeline from transformers.pipelines.text2text_generation import TruncationStrategy diff --git a/optimum/graphcore/pipelines/token_classification.py b/optimum/graphcore/pipelines/token_classification.py index efed797ea..a53e29635 100644 --- a/optimum/graphcore/pipelines/token_classification.py +++ b/optimum/graphcore/pipelines/token_classification.py @@ -1,3 +1,18 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 typing import List, Optional, Tuple from transformers import TokenClassificationPipeline diff --git a/optimum/graphcore/pipelines/zero_shot_classification.py b/optimum/graphcore/pipelines/zero_shot_classification.py index 91df6717e..bf21a6764 100644 --- a/optimum/graphcore/pipelines/zero_shot_classification.py +++ b/optimum/graphcore/pipelines/zero_shot_classification.py @@ -1,3 +1,18 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 transformers import ZeroShotClassificationPipeline from transformers.pipelines.base import PIPELINE_INIT_ARGS from transformers.tokenization_utils import TruncationStrategy diff --git a/optimum/graphcore/trainer.py b/optimum/graphcore/trainer.py index 9f4c96bb2..72a153bf0 100644 --- a/optimum/graphcore/trainer.py +++ b/optimum/graphcore/trainer.py @@ -1,16 +1,17 @@ -# copyright 2021 the huggingface team. all rights reserved. +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 +# 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 +# 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. +# 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 collections import copy diff --git a/optimum/graphcore/trainer_seq2seq.py b/optimum/graphcore/trainer_seq2seq.py index 9ba02183e..5210a5dcf 100644 --- a/optimum/graphcore/trainer_seq2seq.py +++ b/optimum/graphcore/trainer_seq2seq.py @@ -1,4 +1,5 @@ # Copyright 2022 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/trainer_utils.py b/optimum/graphcore/trainer_utils.py index 275003cd5..f280ea3f4 100644 --- a/optimum/graphcore/trainer_utils.py +++ b/optimum/graphcore/trainer_utils.py @@ -1,16 +1,17 @@ -# copyright 2021 the huggingface team. all rights reserved. +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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 +# 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 +# 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. +# 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 functools diff --git a/optimum/graphcore/training_args.py b/optimum/graphcore/training_args.py index cc9030e35..5b174da0a 100644 --- a/optimum/graphcore/training_args.py +++ b/optimum/graphcore/training_args.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/optimum/graphcore/training_args_seq2seq.py b/optimum/graphcore/training_args_seq2seq.py index dab91bb20..960fff86c 100644 --- a/optimum/graphcore/training_args_seq2seq.py +++ b/optimum/graphcore/training_args_seq2seq.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/optimum/graphcore/version.py b/optimum/graphcore/version.py index 5f4d904f6..a1789d2bf 100644 --- a/optimum/graphcore/version.py +++ b/optimum/graphcore/version.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/pyproject.toml b/pyproject.toml index e20f98f65..bf8184ef3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. @@ -28,4 +29,4 @@ line-length = 119 [tool.ruff.isort] lines-after-imports = 2 -known-first-party = ["optimum"] \ No newline at end of file +known-first-party = ["optimum"] diff --git a/setup.py b/setup.py index c7eaf2c66..1c6492f94 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,18 @@ +# Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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 re from setuptools import find_namespace_packages, setup diff --git a/tests/generation/test_framework_agnostic.py b/tests/generation/test_framework_agnostic.py index 0922cd0d7..d9c28a8b6 100644 --- a/tests/generation/test_framework_agnostic.py +++ b/tests/generation/test_framework_agnostic.py @@ -1,5 +1,21 @@ +# Copyright 2023 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. + """ Framework agnostic tests for generate()-related methods. +Adapted from: https://github.com/huggingface/transformers/blob/main/tests/generation/test_framework_agnostic.py """ from typing import Callable diff --git a/tests/generation/test_utils.py b/tests/generation/test_utils.py index 7d5c6a620..79c33a1f5 100644 --- a/tests/generation/test_utils.py +++ b/tests/generation/test_utils.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2020 The HuggingFace Team Inc. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_audio_classification.py b/tests/pipelines/test_pipelines_audio_classification.py index 51554ba56..478e93ab0 100644 --- a/tests/pipelines/test_pipelines_audio_classification.py +++ b/tests/pipelines/test_pipelines_audio_classification.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_automatic_speech_recognition.py b/tests/pipelines/test_pipelines_automatic_speech_recognition.py index 71fd4fda3..ff711a2d4 100644 --- a/tests/pipelines/test_pipelines_automatic_speech_recognition.py +++ b/tests/pipelines/test_pipelines_automatic_speech_recognition.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_common.py b/tests/pipelines/test_pipelines_common.py index 104d1ce15..76b5fe177 100644 --- a/tests/pipelines/test_pipelines_common.py +++ b/tests/pipelines/test_pipelines_common.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_fill_mask.py b/tests/pipelines/test_pipelines_fill_mask.py index 333729b0d..43efcee3e 100644 --- a/tests/pipelines/test_pipelines_fill_mask.py +++ b/tests/pipelines/test_pipelines_fill_mask.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_image_classification.py b/tests/pipelines/test_pipelines_image_classification.py index accd3c5de..1d6a48421 100644 --- a/tests/pipelines/test_pipelines_image_classification.py +++ b/tests/pipelines/test_pipelines_image_classification.py @@ -1,4 +1,5 @@ # Copyright 2021 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_question_answering.py b/tests/pipelines/test_pipelines_question_answering.py index dba0b67bc..06065ab0c 100644 --- a/tests/pipelines/test_pipelines_question_answering.py +++ b/tests/pipelines/test_pipelines_question_answering.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_text_classification.py b/tests/pipelines/test_pipelines_text_classification.py index d5fba9373..cc33d8fba 100644 --- a/tests/pipelines/test_pipelines_text_classification.py +++ b/tests/pipelines/test_pipelines_text_classification.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_token_classification.py b/tests/pipelines/test_pipelines_token_classification.py index 50b565b94..3e850d72e 100644 --- a/tests/pipelines/test_pipelines_token_classification.py +++ b/tests/pipelines/test_pipelines_token_classification.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/pipelines/test_pipelines_zero_shot.py b/tests/pipelines/test_pipelines_zero_shot.py index 26e0b3f61..c8fc7b000 100644 --- a/tests/pipelines/test_pipelines_zero_shot.py +++ b/tests/pipelines/test_pipelines_zero_shot.py @@ -1,4 +1,5 @@ # Copyright 2020 The HuggingFace Team. All rights reserved. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/test_examples.py b/tests/test_examples.py index 1ece5da51..a5c040b9d 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2022 HuggingFace Inc. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/test_examples_match_transformers.py b/tests/test_examples_match_transformers.py index 878368c6b..4fc945327 100644 --- a/tests/test_examples_match_transformers.py +++ b/tests/test_examples_match_transformers.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2022 the HuggingFace Inc. team. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/test_ipu_configuration.py b/tests/test_ipu_configuration.py index e34b60262..cedf2c68b 100644 --- a/tests/test_ipu_configuration.py +++ b/tests/test_ipu_configuration.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 HuggingFace Inc. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/test_modeling_utils.py b/tests/test_modeling_utils.py index b58df76f8..043dabb10 100644 --- a/tests/test_modeling_utils.py +++ b/tests/test_modeling_utils.py @@ -1,3 +1,17 @@ +# Copyright (c) 2023 Graphcore Ltd. 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 unittest from abc import abstractmethod diff --git a/tests/test_pipelined_models.py b/tests/test_pipelined_models.py index 21f978e5a..6b9034658 100644 --- a/tests/test_pipelined_models.py +++ b/tests/test_pipelined_models.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 HuggingFace Inc. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/test_trainer.py b/tests/test_trainer.py index 5b5d38716..a1a553747 100644 --- a/tests/test_trainer.py +++ b/tests/test_trainer.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 the HuggingFace Inc. team. +# Copyright (c) 2022 Graphcore Ltd. 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. diff --git a/tests/test_trainer_seq2seq.py b/tests/test_trainer_seq2seq.py index bd0805881..fc671292e 100644 --- a/tests/test_trainer_seq2seq.py +++ b/tests/test_trainer_seq2seq.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2023 the HuggingFace Inc. team. +# Copyright (c) 2023 Graphcore Ltd. 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. diff --git a/tests/utils.py b/tests/utils.py index 22b5f3b0c..76e2a1d8c 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -1,5 +1,6 @@ # coding=utf-8 # Copyright 2021 HuggingFace Inc. +# Copyright (c) 2022 Graphcore Ltd. 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.