Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
marscrazy committed Jun 1, 2022
0 parents commit dd7e946
Show file tree
Hide file tree
Showing 331 changed files with 37,942 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-18.04

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install torch
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --statistics --ignore=E405,E501,F401,W504,F405,E722,E262,E127,W503,W605,E265,E402,F403,E126,F811,E129,W293,E741
- name: Test with pytest
run: |
sh prepare_test.sh
pytest
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
__pycache__
.idea/
logs/
test_tokenizer.py
samples_text2image/
generate_contexts/
venv/
*__pycache__
.DS_Store
.vscode
*.swo
*.swp
*log
build
dist
eazybigmodel.egg-info
flagai.egg-info
test_report
/data/
/tests/*/data
checkpoints
state_dict
checkpoints*
vocabs
tensorboard*
datasets
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

### Changed

### Removed
89 changes: 89 additions & 0 deletions CLA.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# The Contributor License Agreement

The [Cloud Native Computing Foundation](https://www.cncf.io) (CNCF) defines
the legal status of the contributed code in two different types of _Contributor License Agreements_
(CLAs), [individual contributors](https://github.com/cncf/cla/blob/master/individual-cla.pdf) and [corporations](https://github.com/cncf/cla/blob/master/corporate-cla.pdf).

FlagAI can only accept original source code from CLA signatories.


It is important to read and understand this legal agreement.

## How do I sign?

After creating your first Pull Request the linux-foundation-easycla bot will respond with information regarding your CLA status along with a link to sign the CLA.

<img width="1065" alt="EasyCLA bot" src="https://user-images.githubusercontent.com/69111235/152226443-f6fe61ee-0e92-46c5-b6ea-c0deb718a585.png">

#### 1. Authorize EasyCLA to read some of your GitHub information

<img width="554" alt="GitHub EasyCLA Authorization" src="https://user-images.githubusercontent.com/69111235/152228712-7d22f9d0-9f3c-4226-9ee0-bacba4b47725.png">

Click on the "Please click here to be authorized" link to navigate to the GitHub Authorize Linux Foundation: EasyCLA page. Then click Authorize LF-Engineering to give the Linux Foundation read-only access to list the email addresses associated with your GitHub account.

#### 2. Select from the two types of contributor

<img width="1407" alt="EasyCLA" src="https://user-images.githubusercontent.com/69111235/152224818-1246453a-b086-4a57-9d14-c10d62ad438f.png">


After authorizing EasyCLA, you will be redirected to a page to identify which type of contributor you are.
Select the most appropriate option:
* Individual Contributor: You are contributing as yourself, and not as part of another organization.
* Corporate Contributor: You are contributing on behalf of your employer or other organization.

#### 3. Sign the CLA

Once you select the type of contributor, proceed to Sign the CLA and follow the instructions to complete the signing process through DocuSign.

**Ensure your GitHub e-mail address matches e-mail address used to sign CLA**

After you have filled out the information, Click "Finish" and you will be redirected back to your Pull Request.

#### 4. Look for an email indicating successful signup.

> Hello,
>
> This is a notification email from EasyCLA regarding the project Cloud Native Computing > Foundation (CNCF).
>
> The CLA has now been signed. You can download the signed CLA as a PDF here.
>
> If you need help or have questions about EasyCLA, you can read the documentation or reach out to us for support.
>
> Thanks,
> EasyCLA Support Team


#### 5. Validate your CLA

Once you are redirected back to your GitHub Pull Request, reply with a comment `/easycla` to update the CLA status of your PR.


## Changing your Affiliation

If you've changed employers and still contribute to Kubernetes, your affiliation
needs to be updated. The Cloud Native Computing Foundation uses [gitdm](https://github.com/cncf/gitdm)
to track who is contributing and from where. Create a pull request on the [gitdm](https://github.com/cncf/gitdm)
repository with a change to the corresponding developer affiliation text file.
Your entry should look similar to this:

```
Jorge O. Castro*: jorge!heptio.com, jorge!ubuntu.com, jorge.castro!gmail.com
Heptio
Canonical until 2017-03-31
```

## Troubleshooting

If you encounter any problems signing the CLA and need further assistance, log a ticket by clicking on the link [please submit a support request ticket](https://jira.linuxfoundation.org/plugins/servlet/theme/portal/4) from the EasyCLA bot's response. Someone from the CNCF will respond to your ticket to help.

Should you have any issues using the LF Support Site, send a message to the
backup e-mail support address <[email protected]>

## Setting up the CNCF CLA check

If you are a Kubernetes GitHub organization or repo owner and would like to setup
the Linux Foundation CNCF CLA check for your repositories, [read the docs on setting up the CNCF CLA check](/github-management/setting-up-cla-check.md)


[Linux Foundation Support Site]: https://support.linuxfoundation.org/
1 change: 1 addition & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
All participants agree to abide by the Code of Conduct available at https://lfprojects.org/policies/code-of-conduct/. Please contact [email protected] to report any violations or concerns.
2 changes: 2 additions & 0 deletions COMMITTERS.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Name, Email, Github ID
Guang Liu, [email protected], marcrazy
52 changes: 52 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Contributing to FlagAI

We are happy to accept your contributions to make `FlagAI` better and more awesome! To avoid unnecessary work on either
side, please stick to the following process:

1. Check if there is already [an issue](https://github.com/BAAI-WuDao/Sailing/issues) for your concern.
2. If there is not, open a new one to start a discussion. We hate to close finished PRs!
3. If we decide your concern needs code changes, we would be happy to accept a pull request. Please consider the
commit guidelines below.

## Sign the CLA

Before you can contribute to FlagAI, you will need to sign the [Contributor License Agreement](CLA.md).

## Git Commit Guidelines

If there is already a ticket, use this number at the start of your commit message.
Use meaningful commit messages that described what you did.

**Example:** `GH-42: Added new type of embeddings: DocumentEmbedding.`
**Example:** `ISSUE#123: Fix typo in README.`


## Developing locally

For contributors looking to get deeper into the API we suggest cloning the repository and checking out the unit
tests for examples of how to call methods. Nearly all classes and methods are documented, so finding your way around
the code should hopefully be easy.

### setup

You can either use [Pipenv](https://pipenv.readthedocs.io/) for this:

or create a python environment of your preference and run
```bash
pip install -r requirements.txt
```

### tests
Install `pytest` for testing
```
pip install pytest
```
To run all basic tests execute:
```bash
pytest
```

### code formatting

To ensure a standardized code style we use the formatter [yapf](https://github.com/google/yapf).
You can automatically format the code via `yapf flagai/ -i` in the flair root folder.
70 changes: 70 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
*NOTE: This document is intended to provide an example governance structure for any LF AI and Data Foundation project to consider as a starting point. All projects hosted by LF AI and Data Foundation are not bound by these governance polices, but in absence of any prior governance structure should consider this as a recommended structure*

# Overview

This project aims to be governed in a transparent, accessible way for the benefit of the community. All participation in this project is open and not bound to corporate affilation. Participants are bound to the project's [Code of Conduct](./CODE_OF_CONDUCT.md).

# Project roles

## Contributor

The contributor role is the starting role for anyone participating in the project and wishing to contribute code.

# Process for becoming a contributor

* Review the [Contribution Guidelines](./CONTRIBUTING.md) to ensure your contribution is inline with the project's coding and styling guidelines.
* Submit your code as a PR with the appropriate DCO signoff
* Have your submission approved by the committer(s) and merged into the codebase.

## Committer

The committer role enables the contributor to commit code directly to the repository, but also comes with the responsibility of being a responsible leader in the community.

### Process for becoming a committer

* Show your experience with the codebase through contributions and engagement on the community channels.
* Request to become a committer. To do this, create a new pull request that adds your name and details to the [Committers File](./COMMITTERS.csv) file and request existing committers to approve.
* After the majority of committers approve you, merge in the PR. Be sure to tag the whomever is managing the GitHub permissions to update the committers team in GitHub.

### Committer responsibilities

* Monitor email aliases (if any).
* Monitor Slack (delayed response is perfectly acceptable).
* Triage GitHub issues and perform pull request reviews for other committers and the community.
* Make sure that ongoing PRs are moving forward at the right pace or closing them.
* In general continue to be willing to spend at least 25% of ones time working on the project (~1.25 business days per week).

### When does a committer lose committer status

If a committer is no longer interested or cannot perform the committer duties listed above, they
should volunteer to be moved to emeritus status. In extreme cases this can also occur by a vote of
the committers per the voting process below.

## Lead

The project committers will elect a lead ( and optionally a co-lead ) which will be the primary point of contact for the project and representative to the TAC upon becoming an Active stage project. The lead(s) will be responsible for the overall project health and direction, coordination of activities, and working with other projects and committees as needed for the continuted growth of the project.

# Release Process

Project releases will occur on a scheduled basis as agreed to by the committers.

# Conflict resolution and voting

In general, we prefer that technical issues and committer membership are amicably worked out
between the persons involved. If a dispute cannot be decided independently, the committers can be
called in to decide an issue. If the committers themselves cannot decide an issue, the issue will
be resolved by voting. The voting process is a simple majority in which each committer receives one vote.

# Communication

This project, just like all of open source, is a global community. In addition to the [Code of Conduct](./CODE_OF_CONDUCT.md), this project will:

* Keep all communucation on open channels ( mailing list, forums, chat ).
* Be respectful of time and language differences between community members ( such as scheduling meetings, email/issue responsiveness, etc ).
* Ensure tools are able to be used by community members regardless of their region.

If you have concerns about communication challenges for this project, please contact the committers.

[Code of Conduct]: CODE_OF_CONDUCT.md
[Committers File]: COMMITTERS.csv
[Contribution Guidelines]: CONTRIBUTING.md
Loading

0 comments on commit dd7e946

Please sign in to comment.