Upload 2 files
Browse files- MIT LICENSE.txt +21 -0
- download.sh +60 -0
MIT LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
MIT License
|
2 |
+
|
3 |
+
Copyright (c) [year] [fullname]
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in all
|
13 |
+
copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21 |
+
SOFTWARE.
|
download.sh
ADDED
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
|
3 |
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
4 |
+
# This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
|
5 |
+
|
6 |
+
read -p "Enter the URL from email: " PRESIGNED_URL
|
7 |
+
echo ""
|
8 |
+
read -p "Enter the list of models to download without spaces (7B,13B,70B,7B-chat,13B-chat,70B-chat), or press Enter for all: " MODEL_SIZE
|
9 |
+
TARGET_FOLDER="." # where all files should end up
|
10 |
+
mkdir -p ${TARGET_FOLDER}
|
11 |
+
|
12 |
+
if [[ $MODEL_SIZE == "" ]]; then
|
13 |
+
MODEL_SIZE="7B,13B,70B,7B-chat,13B-chat,70B-chat"
|
14 |
+
fi
|
15 |
+
|
16 |
+
echo "Downloading LICENSE and Acceptable Usage Policy"
|
17 |
+
wget ${PRESIGNED_URL/'*'/"LICENSE"} -O ${TARGET_FOLDER}"/LICENSE"
|
18 |
+
wget ${PRESIGNED_URL/'*'/"USE_POLICY.md"} -O ${TARGET_FOLDER}"/USE_POLICY.md"
|
19 |
+
|
20 |
+
echo "Downloading tokenizer"
|
21 |
+
wget ${PRESIGNED_URL/'*'/"tokenizer.model"} -O ${TARGET_FOLDER}"/tokenizer.model"
|
22 |
+
wget ${PRESIGNED_URL/'*'/"tokenizer_checklist.chk"} -O ${TARGET_FOLDER}"/tokenizer_checklist.chk"
|
23 |
+
(cd ${TARGET_FOLDER} && md5sum -c tokenizer_checklist.chk)
|
24 |
+
|
25 |
+
for m in ${MODEL_SIZE//,/ }
|
26 |
+
do
|
27 |
+
if [[ $m == "7B" ]]; then
|
28 |
+
SHARD=0
|
29 |
+
MODEL_PATH="llama-2-7b"
|
30 |
+
elif [[ $m == "7B-chat" ]]; then
|
31 |
+
SHARD=0
|
32 |
+
MODEL_PATH="llama-2-7b-chat"
|
33 |
+
elif [[ $m == "13B" ]]; then
|
34 |
+
SHARD=1
|
35 |
+
MODEL_PATH="llama-2-13b"
|
36 |
+
elif [[ $m == "13B-chat" ]]; then
|
37 |
+
SHARD=1
|
38 |
+
MODEL_PATH="llama-2-13b-chat"
|
39 |
+
elif [[ $m == "70B" ]]; then
|
40 |
+
SHARD=7
|
41 |
+
MODEL_PATH="llama-2-70b"
|
42 |
+
elif [[ $m == "70B-chat" ]]; then
|
43 |
+
SHARD=7
|
44 |
+
MODEL_PATH="llama-2-70b-chat"
|
45 |
+
fi
|
46 |
+
|
47 |
+
echo "Downloading ${MODEL_PATH}"
|
48 |
+
mkdir -p ${TARGET_FOLDER}"/${MODEL_PATH}"
|
49 |
+
|
50 |
+
for s in $(seq -f "0%g" 0 ${SHARD})
|
51 |
+
do
|
52 |
+
wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 0 --continue ${PRESIGNED_URL/'*'/"${MODEL_PATH}/consolidated.${s}.pth"} -O ${TARGET_FOLDER}"/${MODEL_PATH}/consolidated.${s}.pth"
|
53 |
+
done
|
54 |
+
|
55 |
+
wget ${PRESIGNED_URL/'*'/"${MODEL_PATH}/params.json"} -O ${TARGET_FOLDER}"/${MODEL_PATH}/params.json"
|
56 |
+
wget ${PRESIGNED_URL/'*'/"${MODEL_PATH}/checklist.chk"} -O ${TARGET_FOLDER}"/${MODEL_PATH}/checklist.chk"
|
57 |
+
echo "Checking checksums"
|
58 |
+
(cd ${TARGET_FOLDER}"/${MODEL_PATH}" && md5sum -c checklist.chk)
|
59 |
+
done
|
60 |
+
|