chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:42:37 +08:00
commit 969b3b615d
658 changed files with 160978 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
import re
from pathlib import Path
WORK_DIR = Path(__file__).parents[1]
PATTERN = "(Meta Platforms, Inc. and affiliates)|(Facebook, Inc(\.|,)? and its affiliates)|([0-9]{4}-present(\.|,)? Facebook)|([0-9]{4}(\.|,)? Facebook)"
HEADER = """# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.\n\n"""
#Files in black list must be relative to main repo folder
BLACKLIST = ["tools/benchmarks/llm_eval_harness/open_llm_leaderboard/hellaswag_utils.py"]
if __name__ == "__main__":
for ext in ["*.py", "*.sh"]:
for file in WORK_DIR.rglob(ext):
normalized = file.relative_to(WORK_DIR)
if normalized.as_posix() in BLACKLIST:
continue
text = file.read_text()
if not re.search(PATTERN, text):
text = HEADER + text
file.write_text(text)
@@ -0,0 +1,33 @@
{
"retryOn429": true,
"retryCount": 5,
"fallbackRetryDelay": "10s",
"httpHeaders": [
{
"urls": [
"https://docs.github.com/",
"https://help.github.com/"
],
"headers": {
"Accept-Encoding": "zstd, br, gzip, deflate"
}
}
],
"ignorePatterns": [
{
"pattern": "^http(s)?://127.0.0.1.*"
},
{
"pattern": "^http(s)?://localhost.*"
},
{
"pattern": "https://www.intel.com/content/www/us/en/developer/articles/news/llama2.html"
},
{
"pattern": "http(s.?)?:\/\/(www\.)?linkedin\.com\.*"
},
{
"pattern": "http(s?)?:\/\/(www\.)?medium\.com\/.*"
}
]
}
+23
View File
@@ -0,0 +1,23 @@
# Copyright (c) Meta Platforms, Inc. and affiliates.
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
# Source: https://github.com/pytorch/torchx/blob/main/scripts/spellcheck.sh
set -ex
sudo apt-get install aspell
if [[ -z "$@" ]]; then
sources=$(find -name '*.md')
else
sources=$@
fi
sources_arg=""
for src in $sources; do
sources_arg="${sources_arg} -S $src"
done
if [ ! "$sources_arg" ]; then
echo "No files to spellcheck"
else
pyspelling -c .github/scripts/spellcheck_conf/spellcheck.yaml --name Markdown $sources_arg
fi
@@ -0,0 +1,22 @@
matrix:
- name: Markdown
apsell:
lang: en
d: en_US
dictionary:
wordlists:
- .github/scripts/spellcheck_conf/wordlist.txt
output: .github/scripts/spellcheck_conf/wordlist.dic
encoding: utf-8
pipeline:
- pyspelling.filters.context:
context_visible_first: true
delimiters:
- open: '(?s)^ *(?P<open>`{3,})[a-z0-9]*?$'
close: '^(?P=open)$'
- open: ''
content: 'https?://[-a-zA-Z0-9.]+?\.[a-z]{2,6}[-?=&%.0-9a-zA-Z/_#]*'
close: ''
- pyspelling.filters.markdown:
markdown_extensions:
- markdown.extensions.extra:
File diff suppressed because it is too large Load Diff