Spaces:
Build error
Build error
set max_new_tokens to 300
Browse files- .env.example +1 -0
- llm_toolkit/eval.py +11 -1
- llm_toolkit/llm_utils.py +2 -0
- notebooks/00_Data Analysis.ipynb +0 -0
- notebooks/00a_Data Analysis_greedy_decoding.ipynb +0 -0
- scripts/eval-mac.sh +2 -2
.env.example
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
MODEL_NAME=internlm/internlm2_5-7b-chat-1m
|
2 |
BATCH_SIZE=2
|
|
|
3 |
|
4 |
HF_TOKEN=
|
5 |
|
|
|
1 |
MODEL_NAME=internlm/internlm2_5-7b-chat-1m
|
2 |
BATCH_SIZE=2
|
3 |
+
MAX_NEW_TOKENS=300
|
4 |
|
5 |
HF_TOKEN=
|
6 |
|
llm_toolkit/eval.py
CHANGED
@@ -26,9 +26,18 @@ load_in_4bit = os.getenv("LOAD_IN_4BIT") == "true"
|
|
26 |
data_path = os.getenv("DATA_PATH")
|
27 |
results_path = os.getenv("RESULTS_PATH")
|
28 |
batch_size = int(os.getenv("BATCH_SIZE", 1))
|
|
|
|
|
29 |
|
30 |
print(
|
31 |
-
model_name,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
)
|
33 |
|
34 |
if is_cuda:
|
@@ -88,6 +97,7 @@ evaluate_model_with_repetition_penalty(
|
|
88 |
end_repetition_penalty=1.3,
|
89 |
step_repetition_penalty=0.02,
|
90 |
batch_size=batch_size,
|
|
|
91 |
device=device,
|
92 |
)
|
93 |
|
|
|
26 |
data_path = os.getenv("DATA_PATH")
|
27 |
results_path = os.getenv("RESULTS_PATH")
|
28 |
batch_size = int(os.getenv("BATCH_SIZE", 1))
|
29 |
+
use_english_datasets = os.getenv("USE_ENGLISH_DATASETS") == "true"
|
30 |
+
max_new_tokens = int(os.getenv("MAX_NEW_TOKENS", 2048))
|
31 |
|
32 |
print(
|
33 |
+
model_name,
|
34 |
+
adapter_name_or_path,
|
35 |
+
load_in_4bit,
|
36 |
+
data_path,
|
37 |
+
results_path,
|
38 |
+
use_english_datasets,
|
39 |
+
max_new_tokens,
|
40 |
+
batch_size,
|
41 |
)
|
42 |
|
43 |
if is_cuda:
|
|
|
97 |
end_repetition_penalty=1.3,
|
98 |
step_repetition_penalty=0.02,
|
99 |
batch_size=batch_size,
|
100 |
+
max_new_tokens=max_new_tokens,
|
101 |
device=device,
|
102 |
)
|
103 |
|
llm_toolkit/llm_utils.py
CHANGED
@@ -224,6 +224,7 @@ def evaluate_model_with_repetition_penalty(
|
|
224 |
end_repetition_penalty=1.3,
|
225 |
step_repetition_penalty=0.02,
|
226 |
batch_size=1,
|
|
|
227 |
device="cuda",
|
228 |
):
|
229 |
print(f"Evaluating model: {model_name} on {device}")
|
@@ -243,6 +244,7 @@ def evaluate_model_with_repetition_penalty(
|
|
243 |
device=device,
|
244 |
repetition_penalty=repetition_penalty,
|
245 |
batch_size=batch_size,
|
|
|
246 |
)
|
247 |
|
248 |
model_name_with_rp = f"{model_name}/rpp-{repetition_penalty:.2f}"
|
|
|
224 |
end_repetition_penalty=1.3,
|
225 |
step_repetition_penalty=0.02,
|
226 |
batch_size=1,
|
227 |
+
max_new_tokens=2048,
|
228 |
device="cuda",
|
229 |
):
|
230 |
print(f"Evaluating model: {model_name} on {device}")
|
|
|
244 |
device=device,
|
245 |
repetition_penalty=repetition_penalty,
|
246 |
batch_size=batch_size,
|
247 |
+
max_new_tokens=max_new_tokens,
|
248 |
)
|
249 |
|
250 |
model_name_with_rp = f"{model_name}/rpp-{repetition_penalty:.2f}"
|
notebooks/00_Data Analysis.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
notebooks/00a_Data Analysis_greedy_decoding.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
scripts/eval-mac.sh
CHANGED
@@ -14,12 +14,12 @@ grep MemTotal /proc/meminfo
|
|
14 |
# pip install torch torchvision torchaudio
|
15 |
# pip install -r requirements.txt
|
16 |
|
17 |
-
|
18 |
|
19 |
#./scripts/eval-model.sh Qwen/Qwen2-7B-Instruct
|
20 |
|
21 |
#./scripts/eval-model.sh shenzhi-wang/Llama3.1-8B-Chinese-Chat
|
22 |
|
23 |
-
|
24 |
|
25 |
./scripts/eval-model.sh internlm/internlm2_5-7b-chat
|
|
|
14 |
# pip install torch torchvision torchaudio
|
15 |
# pip install -r requirements.txt
|
16 |
|
17 |
+
./scripts/eval-model.sh shenzhi-wang/Mistral-7B-v0.3-Chinese-Chat
|
18 |
|
19 |
#./scripts/eval-model.sh Qwen/Qwen2-7B-Instruct
|
20 |
|
21 |
#./scripts/eval-model.sh shenzhi-wang/Llama3.1-8B-Chinese-Chat
|
22 |
|
23 |
+
./scripts/eval-model.sh 01-ai/Yi-1.5-9B-Chat
|
24 |
|
25 |
./scripts/eval-model.sh internlm/internlm2_5-7b-chat
|