Spaces:
Running
on
Zero
Running
on
Zero
Update
Browse files- .pre-commit-config.yaml +56 -0
- .python-version +1 -0
- .vscode/extensions.json +8 -0
- .vscode/settings.json +21 -0
- pyproject.toml +51 -0
- uv.lock +0 -0
.pre-commit-config.yaml
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
repos:
|
| 2 |
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
| 3 |
+
rev: v5.0.0
|
| 4 |
+
hooks:
|
| 5 |
+
- id: check-executables-have-shebangs
|
| 6 |
+
- id: check-json
|
| 7 |
+
- id: check-merge-conflict
|
| 8 |
+
- id: check-shebang-scripts-are-executable
|
| 9 |
+
- id: check-toml
|
| 10 |
+
- id: check-yaml
|
| 11 |
+
- id: end-of-file-fixer
|
| 12 |
+
- id: mixed-line-ending
|
| 13 |
+
args: ["--fix=lf"]
|
| 14 |
+
- id: requirements-txt-fixer
|
| 15 |
+
- id: trailing-whitespace
|
| 16 |
+
- repo: https://github.com/myint/docformatter
|
| 17 |
+
rev: v1.7.5
|
| 18 |
+
hooks:
|
| 19 |
+
- id: docformatter
|
| 20 |
+
args: ["--in-place"]
|
| 21 |
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
| 22 |
+
rev: v0.8.4
|
| 23 |
+
hooks:
|
| 24 |
+
- id: ruff
|
| 25 |
+
args: ["--fix"]
|
| 26 |
+
- id: ruff-format
|
| 27 |
+
args: ["--line-length", "119"]
|
| 28 |
+
- repo: https://github.com/pre-commit/mirrors-mypy
|
| 29 |
+
rev: v1.14.0
|
| 30 |
+
hooks:
|
| 31 |
+
- id: mypy
|
| 32 |
+
args: ["--ignore-missing-imports"]
|
| 33 |
+
additional_dependencies:
|
| 34 |
+
[
|
| 35 |
+
"types-python-slugify",
|
| 36 |
+
"types-requests",
|
| 37 |
+
"types-PyYAML",
|
| 38 |
+
"types-pytz",
|
| 39 |
+
]
|
| 40 |
+
- repo: https://github.com/kynan/nbstripout
|
| 41 |
+
rev: 0.8.1
|
| 42 |
+
hooks:
|
| 43 |
+
- id: nbstripout
|
| 44 |
+
args:
|
| 45 |
+
[
|
| 46 |
+
"--extra-keys",
|
| 47 |
+
"metadata.interpreter metadata.kernelspec cell.metadata.pycharm",
|
| 48 |
+
]
|
| 49 |
+
- repo: https://github.com/nbQA-dev/nbQA
|
| 50 |
+
rev: 1.9.1
|
| 51 |
+
hooks:
|
| 52 |
+
- id: nbqa-black
|
| 53 |
+
- id: nbqa-pyupgrade
|
| 54 |
+
args: ["--py37-plus"]
|
| 55 |
+
- id: nbqa-isort
|
| 56 |
+
args: ["--float-to-top"]
|
.python-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
3.10
|
.vscode/extensions.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"recommendations": [
|
| 3 |
+
"ms-python.python",
|
| 4 |
+
"charliermarsh.ruff",
|
| 5 |
+
"streetsidesoftware.code-spell-checker",
|
| 6 |
+
"tamasfe.even-better-toml"
|
| 7 |
+
]
|
| 8 |
+
}
|
.vscode/settings.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"editor.formatOnSave": true,
|
| 3 |
+
"files.insertFinalNewline": false,
|
| 4 |
+
"[python]": {
|
| 5 |
+
"editor.defaultFormatter": "charliermarsh.ruff",
|
| 6 |
+
"editor.formatOnType": true,
|
| 7 |
+
"editor.codeActionsOnSave": {
|
| 8 |
+
"source.fixAll.ruff": "explicit",
|
| 9 |
+
"source.organizeImports": "explicit"
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"[jupyter]": {
|
| 13 |
+
"files.insertFinalNewline": false
|
| 14 |
+
},
|
| 15 |
+
"notebook.output.scrolling": true,
|
| 16 |
+
"notebook.formatOnCellExecution": true,
|
| 17 |
+
"notebook.formatOnSave.enabled": true,
|
| 18 |
+
"notebook.codeActionsOnSave": {
|
| 19 |
+
"source.organizeImports": "explicit"
|
| 20 |
+
}
|
| 21 |
+
}
|
pyproject.toml
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[project]
|
| 2 |
+
name = "llama-2-7b-chat"
|
| 3 |
+
version = "0.1.0"
|
| 4 |
+
description = ""
|
| 5 |
+
readme = "README.md"
|
| 6 |
+
requires-python = ">=3.10"
|
| 7 |
+
dependencies = [
|
| 8 |
+
"accelerate>=1.2.1",
|
| 9 |
+
"bitsandbytes>=0.45.0",
|
| 10 |
+
"gradio>=5.9.1",
|
| 11 |
+
"hf-transfer>=0.1.8",
|
| 12 |
+
"spaces>=0.31.1",
|
| 13 |
+
"torch==2.4.0",
|
| 14 |
+
"transformers>=4.47.1",
|
| 15 |
+
]
|
| 16 |
+
|
| 17 |
+
[tool.ruff]
|
| 18 |
+
line-length = 119
|
| 19 |
+
|
| 20 |
+
[tool.ruff.lint]
|
| 21 |
+
select = ["ALL"]
|
| 22 |
+
ignore = [
|
| 23 |
+
"COM812", # missing-trailing-comma
|
| 24 |
+
"D203", # one-blank-line-before-class
|
| 25 |
+
"D213", # multi-line-summary-second-line
|
| 26 |
+
"E501", # line-too-long
|
| 27 |
+
"SIM117", # multiple-with-statements
|
| 28 |
+
]
|
| 29 |
+
extend-ignore = [
|
| 30 |
+
"D100", # undocumented-public-module
|
| 31 |
+
"D101", # undocumented-public-class
|
| 32 |
+
"D102", # undocumented-public-method
|
| 33 |
+
"D103", # undocumented-public-function
|
| 34 |
+
"D104", # undocumented-public-package
|
| 35 |
+
"D105", # undocumented-magic-method
|
| 36 |
+
"D107", # undocumented-public-init
|
| 37 |
+
"EM101", # raw-string-in-exception
|
| 38 |
+
"FBT001", # boolean-type-hint-positional-argument
|
| 39 |
+
"FBT002", # boolean-default-value-positional-argument
|
| 40 |
+
"PD901", # pandas-df-variable-name
|
| 41 |
+
"PGH003", # blanket-type-ignore
|
| 42 |
+
"PLR0913", # too-many-arguments
|
| 43 |
+
"PLR0915", # too-many-statements
|
| 44 |
+
"TRY003", # raise-vanilla-args
|
| 45 |
+
]
|
| 46 |
+
unfixable = [
|
| 47 |
+
"F401", # unused-import
|
| 48 |
+
]
|
| 49 |
+
|
| 50 |
+
[tool.ruff.format]
|
| 51 |
+
docstring-code-format = true
|
uv.lock
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|