-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
400 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
name: Push rapid_paraformer to pypi | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- 'python/rapid_paraformer/**' | ||
- 'python/docs/doc_whl.md' | ||
- 'python/setup.py' | ||
- '.github/workflows/gen_whl_to_pypi.yml' | ||
|
||
# env: | ||
# RESOURCES_URL: https://github.com/RapidAI/RapidLatexOCR/releases/download/v0.0.0/models.zip | ||
|
||
jobs: | ||
# UnitTesting: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Pull latest code | ||
# uses: actions/checkout@v3 | ||
|
||
# - name: Set up Python 3.7 | ||
# uses: actions/setup-python@v4 | ||
# with: | ||
# python-version: '3.7' | ||
# architecture: 'x64' | ||
|
||
# - name: Display Python version | ||
# run: python -c "import sys; print(sys.version)" | ||
|
||
# - name: Download models | ||
# run: | | ||
# wget $RESOURCES_URL | ||
# ZIP_NAME=${RESOURCES_URL##*/} | ||
# DIR_NAME=${ZIP_NAME%.*} | ||
# unzip $ZIP_NAME | ||
|
||
# - name: Unit testings with rapid_latex_ocr | ||
# run: | | ||
# pip install -r requirements.txt | ||
# pip install pytest | ||
# pytest tests/test*.py | ||
|
||
GenerateWHL_PushPyPi: | ||
needs: UnitTesting | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.7' | ||
architecture: 'x64' | ||
|
||
- name: Run setup.py | ||
run: | | ||
cd python | ||
pip install -r requirements.txt | ||
python -m pip install --upgrade pip | ||
pip install wheel get_pypi_latest_version | ||
python setup.py bdist_wheel ${{ github.event.head_commit.message }} | ||
# - name: Publish distribution 📦 to Test PyPI | ||
# uses: pypa/[email protected] | ||
# with: | ||
# password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
# repository_url: https://test.pypi.org/legacy/ | ||
# packages_dir: dist/ | ||
|
||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/[email protected] | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: python/dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
repos: | ||
- repo: https://gitee.com/SWHL/autoflake | ||
rev: v2.1.1 | ||
hooks: | ||
- id: autoflake | ||
args: | ||
[ | ||
"--recursive", | ||
"--in-place", | ||
"--remove-all-unused-imports", | ||
"--remove-unused-variable", | ||
"--ignore-init-module-imports", | ||
] | ||
files: \.py$ | ||
- repo: https://gitee.com/SWHL/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
files: \.py$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,21 +3,15 @@ | |
# @Contact: [email protected] | ||
from rapid_paraformer import RapidParaformer | ||
|
||
|
||
config_path = 'resources/config.yaml' | ||
config_path = "resources/config.yaml" | ||
|
||
paraformer = RapidParaformer(config_path) | ||
|
||
wav_path = [ | ||
'test_wavs/0478_00017.wav', | ||
'test_wavs/asr_example_zh.wav', | ||
'test_wavs/0478_00017.wav', | ||
'test_wavs/asr_example_zh.wav', | ||
'test_wavs/0478_00017.wav', | ||
'test_wavs/asr_example_zh.wav', | ||
"test_wavs/0478_00017.wav", | ||
"test_wavs/asr_example_zh.wav", | ||
] | ||
|
||
print(wav_path) | ||
# wav_path = 'test_wavs/0478_00017.wav' | ||
result = paraformer(wav_path) | ||
print(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
## rapid_paraformer | ||
|
||
<p align="left"> | ||
<a href=""><img src="https://img.shields.io/badge/OS-Linux%2C%20Win%2C%20Mac-pink.svg"></a> | ||
<a href=""><img src="https://img.shields.io/badge/Python->=3.6,<3.12-aff.svg"></a> | ||
<a href="https://pepy.tech/project/rapid_paraformer"><img src="https://static.pepy.tech/personalized-badge/rapid_paraformer?period=total&units=abbreviation&left_color=grey&right_color=blue&left_text=Downloads"></a> | ||
<a href="https://pypi.org/project/rapid_paraformer/"><img alt="PyPI" src="https://img.shields.io/pypi/v/rapid_paraformer"></a> | ||
<a href="https://semver.org/"><img alt="SemVer2.0" src="https://img.shields.io/badge/SemVer-2.0-brightgreen"></a> | ||
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg"></a> | ||
</p> | ||
|
||
|
||
### Use | ||
1. Install | ||
1. Install the `rapid_paraformer` | ||
```bash | ||
pip install rapid_paraformer | ||
``` | ||
2. Download the **resources.zip** ([Google Drive](https://drive.google.com/drive/folders/1RVQtMe0eB_k6G5TJlmXwPELx4VtF2oCw?usp=sharing) | [Baidu NetDisk](https://pan.baidu.com/s/1zf8Ta6QxFHY3Z75fHNYKrQ?pwd=6ekq)) | ||
```bash | ||
resources | ||
├── [ 700] config.yaml | ||
└── [4.0K] models | ||
├── [ 11K] am.mvn | ||
├── [824M] asr_paraformerv2.onnx | ||
└── [ 50K] token_list.pkl | ||
``` | ||
2. Use | ||
```python | ||
from rapid_paraformer import RapidParaformer | ||
config_path = "resources/config.yaml" | ||
paraformer = RapidParaformer(config_path) | ||
wav_path = [ | ||
"test_wavs/0478_00017.wav", | ||
"test_wavs/asr_example_zh.wav", | ||
] | ||
result = paraformer(wav_path) | ||
print(result) | ||
``` | ||
|
||
### See details for [RapidASR](https://github.com/RapidAI/RapidASR). |
Oops, something went wrong.