Skip to content

Commit

Permalink
Merge pull request #4 from facebookresearch/add_cope_headers
Browse files Browse the repository at this point in the history
Add copyright and license headers to code files
  • Loading branch information
Golovneva authored Sep 20, 2024
2 parents 5420e20 + 0d8fc1c commit e75a946
Show file tree
Hide file tree
Showing 26 changed files with 188 additions and 8 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/headers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: headers
run-name: License headers check by ${{ github.actor }}

on: [push, pull_request]

jobs:
header-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check License Header
uses: apache/skywalking-eyes/header@main
13 changes: 13 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
header:
license:
content: |
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
paths:
- "**/*.py"
- "**/*.sh"

comment: never
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ The library needed to run our code is
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests.

## License
This project is licensed under the MIT License - see the LICENSE.md file for details. The license applies to the released data as well.
This project is licensed under the MIT License - see the `LICENSE` file for details. The license applies to the released data as well.

## Contact
RAM is currently maintained by Olga Golovneva, Ilia Kulikov, Xian Li, Richard Pang, Sainbayar Sukhbaatar, Tianlu Wang, Jason Weston, Jing Xu, Jane Dwivedi-Yu, Ping Yu, Weizhe Yuan.
RAM is currently maintained by Olga Golovneva, Ilia Kulikov, Janice Lan, Xian Li, Richard Pang, Sainbayar Sukhbaatar, Tianlu Wang, Jason Weston, Jing Xu, Jane Dwivedi-Yu, Ping Yu, Weizhe Yuan.
For any queries, please reach out to [Jing Xu](https://github.com/jxmsML).
7 changes: 7 additions & 0 deletions projects/cope/eval.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from argparse import ArgumentParser

import torch
Expand Down
6 changes: 6 additions & 0 deletions projects/cope/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/sh

# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.


# Example set of commands that generates data, trains, and evaluates.

function gen_data {
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/scripts/count_data_gen.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import argparse
import json
import os
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/cope/context_position.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import math
from argparse import ArgumentParser, BooleanOptionalAction
from typing import Optional
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import argparse
import logging

Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/data/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

CONTEXT_KEY = "context"
QUESTION_KEY = "question"
ANSWER_KEY = "answer"
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/data/data_collator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import torch

from .constants import (
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/data/simple.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import json
import os

Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/data/tokenizer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from abc import ABC, abstractmethod

from .constants import ANSWER_KEY, CONTEXT_KEY, QUESTION_KEY
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import logging
import os
import random
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from argparse import ArgumentParser, BooleanOptionalAction, Namespace

import torch
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/models/base.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from abc import ABC, abstractmethod
from typing import List, Optional

Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/models/relative_position.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from typing import Optional

import torch
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/models/simple_transformer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from argparse import ArgumentParser, BooleanOptionalAction
from typing import List, Optional

Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/models/transformer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import math
from typing import Optional

Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/trainer.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import logging
import time
from argparse import ArgumentParser, BooleanOptionalAction, Namespace
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from dataclasses import dataclass
from typing import Dict, List, Optional

Expand Down
9 changes: 8 additions & 1 deletion projects/cope/src/utils/checkpoint.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
"""Checkpointing utils"""
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import logging
import os
Expand All @@ -8,6 +13,8 @@
from torch import distributed
from torch.distributed.fsdp import FullyShardedDataParallel as FSDP

"""Checkpointing utils"""


def add_args(parser: ArgumentParser):
group = parser.add_argument_group("Checkpoint")
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/utils/distributed.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import contextlib
import functools
import os
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/utils/logger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

import math
import os
from argparse import ArgumentParser, BooleanOptionalAction
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/src/utils/world.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from abc import ABC, abstractmethod
from argparse import ArgumentParser, BooleanOptionalAction
from typing import Optional
Expand Down
7 changes: 7 additions & 0 deletions projects/cope/train.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from argparse import ArgumentParser

from src.main import add_train_args, train
Expand Down
11 changes: 6 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) Meta Platforms, Inc. and affiliates
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
"""
Copyright (c) Meta Platforms, Inc. and affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
"""

from setuptools import find_packages, setup

Expand Down

0 comments on commit e75a946

Please sign in to comment.