Skip to content

Commit

Permalink
local conflicts resolved
Browse files Browse the repository at this point in the history
Signed-off-by: ftgreat <[email protected]>
  • Loading branch information
ftgreat committed Mar 29, 2023
0 parents commit 6b6d8b8
Show file tree
Hide file tree
Showing 688 changed files with 1,838,768 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: 'bug'
assignees: 'BAAI-OpenPlatform'

---

**Describe the bug**
A clear and concise description of what the bug is.

**Tasks**
- [ ] An officially supported task in the examples folder (such as GLUE/Title-generation, ...)
- [ ] My own task or dataset

**To Reproduce**
```python
Error code
```

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**OS (please complete the following information):**
- OS: [e.g. ubuntu18.04]
- Version [e.g. v1.0.0]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: '[Feature]'
labels: 'enhancement'
assignees: 'BAAI-OpenPlatform,ftgreat'

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Question
about: Create a question to request further information
title: "[Question]"
labels: 'question'
assignees: 'BAAI-OpenPlatform'

---

**Describe the question**
A clear and concise description of what the question is.

**Additional context**
Add any other context about the question here.
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Pull Request
title: '[PR]'
assignees: 'BAAI-OpenPlatform,ftgreat'

---

### Description
Please describe here what the PR does.

### Checklist
- [ ] bug fixed
- [ ] new feature provided
- [ ] documentation updated
- [ ] tests added
42 changes: 42 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 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: self-hosted

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 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install torch
python setup.py install
- 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
31 changes: 31 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

jobs:
deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
__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
qqp
glm_large_qqp_pytorch
wandb
clip_benchmark_datasets
examples/AltCLIP/clip_benchmark_datasets
examples/glm_pretrain/data.lazy
examples/glm_pretrain/examples/glm_pretrain/data.lazy
examples/vit_cifar100/cifar100
examples/vit_cifar100/data
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
CPM-1 model examples
### 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/FlagAI-Open/FlagAI/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
python setup.py install
```

### 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.
Loading

0 comments on commit 6b6d8b8

Please sign in to comment.