From fea921d38265fad7d92b952f152a2aac314c3207 Mon Sep 17 00:00:00 2001 From: VictorSanh Date: Wed, 28 Aug 2019 04:45:39 +0000 Subject: [PATCH] add licensing --- examples/distillation/dataset.py | 17 +++++++++++++++++ examples/distillation/distiller.py | 17 +++++++++++++++++ examples/distillation/scripts/binarized_data.py | 17 +++++++++++++++++ .../distillation/scripts/extract_for_distil.py | 17 +++++++++++++++++ examples/distillation/scripts/token_counts.py | 17 +++++++++++++++++ examples/distillation/train.py | 17 +++++++++++++++++ examples/distillation/utils.py | 17 +++++++++++++++++ 7 files changed, 119 insertions(+) diff --git a/examples/distillation/dataset.py b/examples/distillation/dataset.py index 6256ce1144..b9f58f775e 100644 --- a/examples/distillation/dataset.py +++ b/examples/distillation/dataset.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +Dataloaders to train DilBERT. +""" from typing import List import math from itertools import chain diff --git a/examples/distillation/distiller.py b/examples/distillation/distiller.py index c9c4458abc..c2d4a9785a 100644 --- a/examples/distillation/distiller.py +++ b/examples/distillation/distiller.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +The distiller to distil DilBERT. +""" import os import math from tensorboardX import SummaryWriter diff --git a/examples/distillation/scripts/binarized_data.py b/examples/distillation/scripts/binarized_data.py index a5fab286b4..c79001bb5e 100644 --- a/examples/distillation/scripts/binarized_data.py +++ b/examples/distillation/scripts/binarized_data.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +Preprocessing script before training DilBERT. +""" import argparse import pickle import random diff --git a/examples/distillation/scripts/extract_for_distil.py b/examples/distillation/scripts/extract_for_distil.py index 27266c82ea..1cbf19d2cf 100644 --- a/examples/distillation/scripts/extract_for_distil.py +++ b/examples/distillation/scripts/extract_for_distil.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +Preprocessing script before training DilBERT. +""" from pytorch_transformers import BertForPreTraining import torch import argparse diff --git a/examples/distillation/scripts/token_counts.py b/examples/distillation/scripts/token_counts.py index 564dc64c8a..2f5ed83922 100644 --- a/examples/distillation/scripts/token_counts.py +++ b/examples/distillation/scripts/token_counts.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +Preprocessing script before training DilBERT. +""" from collections import Counter import argparse import pickle diff --git a/examples/distillation/train.py b/examples/distillation/train.py index a058182966..5af42dd8f4 100644 --- a/examples/distillation/train.py +++ b/examples/distillation/train.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +Training DilBERT. +""" import os import argparse import pickle diff --git a/examples/distillation/utils.py b/examples/distillation/utils.py index b3a9f15891..14bb0e0016 100644 --- a/examples/distillation/utils.py +++ b/examples/distillation/utils.py @@ -1,3 +1,20 @@ +# coding=utf-8 +# Copyright 2019-present, 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. +""" +Utils to train DilBERT. +""" import git import json import os