Skip to content

Commit 0635cfe

Browse files
committed
chore: add pre-commit
1 parent 7d18d23 commit 0635cfe

File tree

5 files changed

+33
-5
lines changed

5 files changed

+33
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Session.vim
99
.idea
1010
__pycache__
1111
.pytest*
12-
venv
12+
venv*
13+
.venv*
1314
my_train
1415
.DS_Store
1516
models/*

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
repos:
2+
- repo: local
3+
hooks:
4+
- id: black-formatter-check
5+
name: black-formatter-check
6+
entry: black --check
7+
language: system
8+
types: [python]
9+
stages: [pre-commit]
10+
fail_fast: true
11+
verbose: true
12+
- id: pylint-check
13+
name: pylint-check
14+
entry: pylint --rcfile=.pylintrc -rn -sn
15+
language: system
16+
types: [python]
17+
stages: [pre-commit]
18+
fail_fast: true
19+
require_serial: true
20+
verbose: true

.pylintrc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,4 @@ min-public-methods=2
580580
[EXCEPTIONS]
581581

582582
# Exceptions that will emit a warning when being caught. Defaults to
583-
# "BaseException, Exception".
584-
overgeneral-exceptions=BaseException,
585-
Exception
583+
overgeneral-exceptions=

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,21 @@ pip3 install -e ".[tf2.x]" # or ".[tf2.x-gpu]" or ".[tf2.x-apple]" for apple m1
115115

116116
Due to tensorflow-text is not built for Apple Sillicon, we need to install it with the prebuilt wheel file from [sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon](https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon)
117117

118+
```bash
119+
git clone https://github.com/TensorSpeech/TensorFlowASR.git
120+
cd TensorFlowASR
121+
pip3 install -e "." # or pip3 install -e ".[dev] for development # or pip3 install "TensorFlowASR[dev]" from PyPi
122+
pip3 install tensorflow~=2.14.0 # change minor version if you want
123+
```
124+
118125
Do this after installing TensorFlowASR with tensorflow above
119126

120127
```bash
121128
TF_VERSION="$(python3 -c 'import tensorflow; print(tensorflow.__version__)')" && \
122129
TF_VERSION_MAJOR="$(echo $TF_VERSION | cut -d'.' -f1,2)" && \
130+
PY_VERSION="$(python3 -c 'import platform; major, minor, patch = platform.python_version_tuple(); print(f"{major}{minor}");')" && \
123131
URL="https://github.com/sun1638650145/Libraries-and-Extensions-for-TensorFlow-for-Apple-Silicon" && \
124-
pip3 install "${URL}/releases/download/v${TF_VERSION_MAJOR}/tensorflow_text-${TF_VERSION_MAJOR}.0-cp310-cp310-macosx_11_0_arm64.whl"
132+
pip3 install "${URL}/releases/download/v${TF_VERSION_MAJOR}/tensorflow_text-${TF_VERSION_MAJOR}.0-cp${PY_VERSION}-cp${PY_VERSION}-macosx_11_0_arm64.whl"
125133
```
126134

127135
### Running in a container

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pylint~=3.1.0
1818
matplotlib~=3.7.2
1919
pydot~=1.4.2
2020
graphviz~=0.20.1
21+
pre-commit~=3.7.0
2122

2223
# extra=tf2-12
2324
tensorflow~=2.12.0

0 commit comments

Comments
 (0)