Skip to content

Commit 9946165

Browse files
chore: add pre-commit (#1569)
1 parent 142cdab commit 9946165

File tree

78 files changed

+346
-234
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+346
-234
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ body:
55
id: system-info
66
attributes:
77
label: System Info
8-
description: |
8+
description: |
99
Please share your system info with us (`text-generation-launcher --env` if installed locally).
10-
The full command line used that causes issues:
10+
The full command line used that causes issues:
1111
OS version:
1212
Rust version (if self-compiling, `cargo version`):
1313
Model being used (`curl 127.0.0.1:8080/info | jq`):
1414
If local model please explicit the kind of model and/or equivalents.
15-
Hardware used (GPUs, how many, on which cloud) (`nvidia-smi`):
15+
Hardware used (GPUs, how many, on which cloud) (`nvidia-smi`):
1616
Deployment specificities (Kubernetes, EKS, AKS, any particular deployments):
1717
The current version being used:
1818
@@ -52,11 +52,11 @@ body:
5252
5353
placeholder: |
5454
Steps to reproduce the behavior:
55-
55+
5656
1.
5757
2.
5858
3.
59-
59+
6060
6161
- type: textarea
6262
id: expected-behavior

.github/ISSUE_TEMPLATE/feature-request.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ body:
1919
label: Motivation
2020
description: |
2121
Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too.
22-
22+
2323
2424
- type: textarea
2525
id: contribution

.github/workflows/autodocs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ on:
66
jobs:
77
update_docs:
88
runs-on: ubuntu-latest
9-
9+
1010
steps:
1111
- name: Checkout code
1212
uses: actions/checkout@v2
13-
13+
1414
- name: Install Launcher
1515
id: install-launcher
1616
run: cargo install --git https://github.com/${{ github.repository }} --branch ${{ github.head_ref }} text-generation-launcher
17-
17+
1818
- name: Check launcher Docs are up-to-date
1919
run: |
2020
echo text-generation-launcher --help

.github/workflows/build_pr_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
commit_sha: ${{ github.event.pull_request.head.sha }}
1717
pr_number: ${{ github.event.number }}
1818
package: text-generation-inference
19-
additional_args: --not_python_module
19+
additional_args: --not_python_module

.github/workflows/tests.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,11 @@ jobs:
7171
pip install pytest
7272
export HUGGING_FACE_HUB_TOKEN=${{ secrets.HUGGING_FACE_HUB_TOKEN }}
7373
pytest -s -vv server/tests
74-
- name: Run Rust fmt
74+
- name: Pre-commit checks
7575
run: |
76-
cargo fmt --check
77-
- name: Run Rust clippy
78-
run: |
79-
cargo clippy
76+
pip install pre-commit
77+
pre-commit install
78+
pre-commit run --all-files
8079
- name: Run Rust tests
8180
run: |
8281
cargo test

.github/workflows/upload_pr_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ jobs:
1313
package_name: text-generation-inference
1414
secrets:
1515
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}
16-
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}
16+
comment_bot_token: ${{ secrets.COMMENT_BOT_TOKEN }}

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@ server/exllama_kernels/exllama_kernels/hip_func/
1111
*_hip.cuh
1212
server/exllama_kernels/exllama_kernels/hip_buffers.cuh
1313
server/exllama_kernels/exllama_kernels/exllama_ext_hip.cpp
14-

.pre-commit-config.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.5.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
exclude: docs/source/basic_tutorials/launcher.md
9+
- repo: https://github.com/psf/black
10+
rev: 24.2.0
11+
hooks:
12+
- id: black
13+
- repo: https://github.com/doublify/pre-commit-rust
14+
rev: v1.0
15+
hooks:
16+
- id: fmt
17+
- id: cargo-check
18+
- id: clippy

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
2+
33
<a href="https://www.youtube.com/watch?v=jlMAX2Oaht0">
44
<img width=560 width=315 alt="Making TGI deployment optimal" src="https://huggingface.co/datasets/Narsil/tgi_assets/resolve/main/thumbnail.png">
55
</a>
@@ -228,7 +228,7 @@ text-generation-launcher --model-id mistralai/Mistral-7B-Instruct-v0.2
228228
You can also quantize the weights with bitsandbytes to reduce the VRAM requirement:
229229

230230
```shell
231-
text-generation-launcher --model-id mistralai/Mistral-7B-Instruct-v0.2 --quantize
231+
text-generation-launcher --model-id mistralai/Mistral-7B-Instruct-v0.2 --quantize
232232
```
233233

234234
4bit quantization is available using the [NF4 and FP4 data types from bitsandbytes](https://arxiv.org/pdf/2305.14314.pdf). It can be enabled by providing `--quantize bitsandbytes-nf4` or `--quantize bitsandbytes-fp4` as a command line argument to `text-generation-launcher`.

benchmark/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,3 @@ tui = {package = "ratatui", version = "0.23", default-features = false, features
2929
tracing = "0.1.37"
3030
tracing-subscriber = { version = "0.3.17", features = ["json", "env-filter"] }
3131
hf-hub = "0.3.1"
32-

0 commit comments

Comments
 (0)