Skip to content

Commit

Permalink
add pyproject.toml for ruff linter, update README.md link to LLaMa 3.…
Browse files Browse the repository at this point in the history
…1 70B, add new top level dirs to add_spdx_header.py (#46)
  • Loading branch information
tstescoTT authored Nov 29, 2024
1 parent cc47f6c commit 9b35e17
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ Please follow setup instructions found in each model folder's README.md doc
## Model Implementations
| Model | Hardware |
|----------------|-----------------------------|
| [LLaMa 3.1 70B](tt-metal-llama3-70b/README.md) | TT-QuietBox & TT-LoudBox |
| [LLaMa 3.1 70B](vllm-tt-metal-llama3-70b/README.md) | TT-QuietBox & TT-LoudBox |
| [Mistral 7B](tt-metal-mistral-7b/README.md) | n150 and n300|
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# departure from defaults, see: https://docs.astral.sh/ruff/configuration/
[tool.ruff]

# Python 3.8
target-version = "py38"

[tool.ruff.lint]
ignore = ["E402"]
11 changes: 10 additions & 1 deletion scripts/add_spdx_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,32 @@

SPDX_DATE = str(current_year) + " Tenstorrent AI ULC\n"


def add_spdx_header(file_path):
with open(file_path, "r+") as file:
content = file.read()
if "SPDX-License-Identifier" not in content:
file.seek(0, 0)
file.write(SPDX_HEADER + SPDX_DATE + "\n" + content)


if __name__ == "__main__":
# List of directories to process here
repo_root = Path(__file__).resolve().parent.parent
directories_to_process = [
repo_root / "tt-metal-llama3-70b",
repo_root / "vllm-tt-metal-llama3-70b",
repo_root / "tt-metal-mistral-7b",
repo_root / "tests",
repo_root / "utils",
repo_root / "evals",
repo_root / "benchmarking",
]
# Walk through the specified directories and add the header to all relevant files
for directory in directories_to_process:
for file_path in directory.rglob("*"):
# Check if the file is Python, Dockerfile, or Bash
if file_path.suffix in (".py", ".sh") or file_path.name.endswith("Dockerfile"):
if file_path.suffix in (".py", ".sh") or file_path.name.endswith(
"Dockerfile"
):
add_spdx_header(file_path)

0 comments on commit 9b35e17

Please sign in to comment.