Skip to content

Commit 0abc1bb

Browse files
committed
fix docs
1 parent d680e22 commit 0abc1bb

File tree

25 files changed

+159
-708
lines changed

25 files changed

+159
-708
lines changed

.dev_scripts/ci_container_test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
if [ "$MODELSCOPE_SDK_DEBUG" == "True" ]; then
22
# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
33
pip install -r requirements/tests.txt -i https://mirrors.aliyun.com/pypi/simple/
4-
git config --global --add safe.directory /ms-swift
4+
git config --global --add safe.directory /twinkle
55
git config --global user.email tmp
66
git config --global user.name tmp.com
77

.dev_scripts/dockerci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
MODELSCOPE_CACHE_DIR_IN_CONTAINER=/modelscope_cache
33
CODE_DIR=$PWD
4-
CODE_DIR_IN_CONTAINER=/ms-swift
4+
CODE_DIR_IN_CONTAINER=/twinkle
55
MODELSCOPE_SDK_DEBUG=True
66
echo "$USER"
77
gpus='0,1 2,3'
@@ -21,7 +21,7 @@ do
2121
flock -n "$lock_fd" || { echo "WARN: gpu $gpu is in use!" >&2; idx=$((idx+1)); continue; }
2222
echo "get gpu lock $gpu"
2323

24-
CONTAINER_NAME="swift-ci-$idx"
24+
CONTAINER_NAME="twinkle-ci-$idx"
2525
let is_get_file_lock=true
2626

2727
# pull image if there are update

.pre-commit-config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ repos:
1717
(?x)^(
1818
examples/|
1919
tests/run.py|
20-
swift/cli/sft.py
2120
)$
2221
- repo: https://github.com/google/yapf
2322
rev: v0.43.0

.pre-commit-config_local.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ repos:
1717
(?x)^(
1818
examples/|
1919
tests/run.py|
20-
swift/cli/sft.py
2120
)$
2221
- repo: /home/admin/pre-commit/mirrors-yapf
2322
rev: v0.30.0

CONTRIBUTING.md

Lines changed: 50 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,67 @@
1-
# Contributor Guide
1+
# Contributor Guidelines
22

3-
_Welcome to offer PRs, bug reports, documentation supplements or other types of contributions to SWIFT!_
3+
*Welcome to contribute Feature PRs, Bug reports, documentation, or other types of contributions to twinkle!*
44

55
## Table of Contents
6+
67
- [Code of Conduct](#-code-of-conduct)
78
- [Contribution Process](#-contribution-process)
8-
- [Hardware support](#-Hardware-support)
9+
- [Resource Support](#-resource-support)
910

1011
## 📖 Code of Conduct
11-
Please refer to our [Code of Conduct documentation](./CODE_OF_CONDUCT.md).
12+
13+
Please refer to our [Code of Conduct document](./CODE_OF_CONDUCT.md).
1214

1315
## 🔁 Contribution Process
16+
1417
### What We Need
15-
- New Technologies and New Models: SWIFT needs to support more open-source models and datasets, or new technologies that we have not paid attention to. If you are interested please submit a PR to us.
16-
- Technical Propagation: If you are interested in technical propagation, you are welcome to help us write tutorials, documents or videos on any website, and send us the link.
17-
- Community Contribution: You can write technical articles related to SWIFT, and submit them to us. After review and approval, we will publish them on the official ModelScope accounts (Zhihu, WeChat, etc.), with your name assigned.
18+
19+
- New components: You can contribute excellent components to the twinkle project, or contribute them to the modelhub in the ModelScope/Hugging Face community following the component protocol, making them available for other developers to use
20+
- New kernels: You can contribute low-level kernels to the twinkle project. These kernels can be integrated into models to achieve better training value
21+
22+
Your contributions will help other developers. Please add your component name, location, and usage documentation link in the Community Components section of the README in your code PR.
1823

1924
### Incentives
20-
- we will issue electronic certificates to contributors on behalf of the ModelScope community, to encourage your selfless contributions.
21-
- We will offer small souvenirs related to the ModelScope Community.
22-
- We will provide free A10 computing power during the development period. For more details, please refer to [Hardware-support](#-Hardware-support) section.
23-
24-
### Submitting PR (Pull Requests)
25-
26-
Any feature development is carried out in the form of Fork and then PR on GitHub.
27-
1. Fork: Go to the [ms-swift](https://github.com/modelscope/ms-swift) page and click the **Fork button**. After completion, a SWIFT code repository will be cloned under your personal organization.
28-
2. Clone: Clone the code repository generated in the first step to your local machine and **create a new branch** for development. During development, please click the **Sync Fork button** in time to synchronize with the `main` branch to prevent code expiration and conflicts.
29-
3. Submit PR: After development and testing, push the code to the remote branch. On GitHub, go to the **Pull Requests page**, create a new PR, select your code branch as the source branch, and the `modelscope/swift:main` branch as the target branch.
30-
31-
4. Write Description: It is necessary to provide a good feature description in the PR, so that the reviewers know the content of your modification.
32-
5. Review: We hope that the code to be merged is concise and efficient, so we may raise some questions and discuss them. Please note that any issues raised in the review are aimed at the code itself, not at you personally. Once all issues are discussed and resolved, your code will be approved.
33-
34-
### Code Standards and Development Approach
35-
SWIFT has conventional variable naming conventions and development approaches. Please follow these approaches as much as possible during development.
36-
1. Variable names are separated by underscores, and class names are named with the first letter of each word capitalized.
37-
2. All Python indentation uses four spaces instead of a tab.
38-
3. Choose well-known open-source libraries, avoid using closed-source libraries or unstable open-source libraries, and avoid repeating the existing code.
39-
40-
After the PR is submitted, SWIFT will perform two types of tests:
41-
- Code Lint Test: A static code compliance check test. please make sure that you have performed code lint locally in advance.
42-
```shell
43-
pip install pre-commit # In the swift folder
44-
pre-commit run --all-files # Fix the errors reported by pre-commit until all checks are successful
45-
```
46-
- CI Tests: Smoke tests and unit tests, please refer to the next section.
4725

48-
### Running CI Tests
49-
Before submitting the PR, please ensure that your development code is protected by test cases, such as smoke tests for new features, or unit tests for various edge cases. Reviewers will also pay attention to this during code review. At the same time, there will be dedicated services running CI Tests, running all test cases, and the code can only be merged after the test cases pass.
26+
- We will issue electronic certificates to contributors on behalf of the ModelScope community to acknowledge your selfless contributions.
27+
- We will give away ModelScope community merchandise and small gifts.
28+
29+
### Submitting PRs (Pull Requests)
30+
31+
All feature development is conducted on GitHub using a Fork-then-PR workflow.
32+
33+
1. Fork: Go to the [twinkle](https://github.com/modelscope/twinkle) page and click the **Fork button**. This will clone a twinkle repository under your personal organization
34+
35+
2. Clone: Clone the repository created in step one to your local machine and **create a new branch** for development. During development, please click the **Sync Fork button** regularly to sync with the `main` branch to prevent code from becoming outdated and causing conflicts
5036

51-
Additionally, since some important tests have been skipped due to long running time, to ensure that your logic is correct, you can run the test locally:
52-
```shell
53-
python tests/llm/test_run.py
54-
```
55-
Please make sure this test can pass normally.
37+
3. Submit PR: After development and testing are complete, push your code to the remote branch. On GitHub, click the **Pull Requests page** and create a new PR. Select your code branch as the source branch and `modelscope/twinkle:main` as the target branch
5638

57-
## ✅ Hardware support
39+
4. Write Description: It is essential to provide a good feature description in your PR so that reviewers understand your changes
40+
41+
5. Review: We want the merged code to be clean and efficient, so we may raise some questions for discussion. Please note that any questions raised during review are about the code itself, not about you personally. Once all issues have been discussed and resolved, your code will be approved
42+
43+
### Code Standards and Development Practices
44+
45+
twinkle has established conventions for variable naming and development practices. Please try to follow these conventions during development.
46+
47+
1. Variable names use underscore separation; class names use PascalCase (capitalize the first letter of each word)
48+
2. All Python indentation uses four spaces instead of one tab
49+
3. Use well-known open-source libraries; avoid closed-source or unstable open-source libraries; avoid reinventing the wheel
50+
51+
twinkle runs two types of tests after a PR is submitted:
52+
53+
- Code Lint Tests: Static code analysis tests. To ensure this test passes, please run Code lint locally beforehand. Here's how:
54+
55+
```shell
56+
pip install pre-commit
57+
pre-commit run --all-files
58+
# Fix any errors reported by pre-commit until all checks pass
59+
```
60+
61+
- CI Tests: Smoke tests and unit tests. Please refer to the next section
62+
63+
### Running CI Tests
5864

59-
SWIFT will provide hardware support for developers, including free GPUs. If needed, please email us ([contact@modelscope.cn](mailto:contact@modelscope.cn)) or join our WeChat group:
65+
Before submitting a PR, please ensure your development code is protected by test cases. For example, smoke tests for new features, or unit tests for various edge cases. Reviewers will also pay attention to this during code review. Additionally, a dedicated service will run CI Tests, executing all test cases. Code can only be merged after all test cases pass.
6066

61-
<p align="left">
62-
<img src="asset/wechat.png" width="250" style="display: inline-block;">
63-
</p>
67+
Please ensure these tests pass successfully.

docs/source/.readthedocs.yaml

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,15 @@
11
# .readthedocs.yaml
2-
# Read the Docs configuration file
3-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
4-
5-
# Required
62
version: 2
73

8-
# Set the OS, Python version and other tools you might need
94
build:
105
os: ubuntu-22.04
116
tools:
127
python: "3.11"
8+
jobs:
9+
pre_install:
10+
- pip install poetry
11+
- poetry config virtualenvs.create false
12+
- poetry install --only docs --no-interaction --no-ansi
1313

14-
# Build documentation in the "docs/" directory with Sphinx
1514
sphinx:
16-
configuration: docs/source/conf.py
17-
18-
# Optionally build your docs in additional formats such as PDF and ePub
19-
# formats:
20-
# - pdf
21-
# - epub
22-
23-
# Optional but recommended, declare the Python requirements required
24-
# to build your documentation
25-
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
26-
python:
27-
install:
28-
- requirements: requirements/docs.txt
29-
- requirements: requirements/framework.txt
15+
configuration: docs/source/conf.py
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
LRScheduler
2+
===============
3+
.. toctree::
4+
:maxdepth: 1
5+
6+
CosineWarmupScheduler.md
7+
LinearWarmupScheduler.md
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
任务处理器
2+
===============
3+
.. toctree::
4+
:maxdepth: 1
5+
6+
InputProcessor.md
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
指标
2+
===============
3+
.. toctree::
4+
:maxdepth: 1
5+
6+
TrainMetric.md
7+
LossMetric.md
8+
Accuracy.md
9+
构建指标.md
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
损失
2+
===============
3+
.. toctree::
4+
:maxdepth: 1
5+
6+
CrossEntropy.md
7+
构建损失.md

0 commit comments

Comments
 (0)