Spaces:
Build error
Build error
fixed bug for eval-mgtv-llama3_8b.sh
Browse files- competition/11_Llama-3_8b_analysis.ipynb +0 -0
- competition/11a_Llama-3_8b_p2_analysis.ipynb +0 -0
- llm_toolkit/eval_logical_reasoning.py +14 -4
- novel-translation/00_Data_Analysis.ipynb +0 -0
- novel-translation/01_Qwen2-0.5B_Unsloth.ipynb +0 -0
- novel-translation/02_Qwen2-1.5B_Unsloth.ipynb +0 -0
- novel-translation/03_Qwen2-0.5B_1.5B-4bit.ipynb +0 -0
- novel-translation/04_tune-small-no-flash-attn.ipynb +0 -0
- novel-translation/05_tune-small-with-flash-attn.ipynb +0 -0
- novel-translation/06_tune-small-py3.11.ipynb +0 -0
- novel-translation/07_tune-lf-py3.11.ipynb +0 -0
- novel-translation/07r2_tune-lf-py3.11.ipynb +0 -0
- novel-translation/08_eval-lf-py3.11.ipynb +0 -0
- novel-translation/08r2_eval-lf-py3.11.ipynb +0 -0
- novel-translation/09_tune-lf-medium-py3.11.ipynb +0 -0
- scripts/eval-mgtv-llama3_8b.sh +4 -0
competition/11_Llama-3_8b_analysis.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
competition/11a_Llama-3_8b_p2_analysis.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
llm_toolkit/eval_logical_reasoning.py
CHANGED
@@ -23,7 +23,11 @@ load_in_4bit = os.getenv("LOAD_IN_4BIT") == "true"
|
|
23 |
data_path = os.getenv("LOGICAL_REASONING_DATA_PATH")
|
24 |
results_path = os.getenv("LOGICAL_REASONING_RESULTS_PATH")
|
25 |
use_english_datasets = os.getenv("USE_ENGLISH_DATASETS") == "true"
|
26 |
-
|
|
|
|
|
|
|
|
|
27 |
|
28 |
print(model_name, adapter_name_or_path, load_in_4bit, data_path, results_path)
|
29 |
|
@@ -34,7 +38,10 @@ print(f"(1) GPU = {gpu_stats.name}. Max memory = {max_memory} GB.")
|
|
34 |
print(f"{start_gpu_memory} GB of memory reserved.")
|
35 |
|
36 |
model, tokenizer = load_model(
|
37 |
-
model_name,
|
|
|
|
|
|
|
38 |
)
|
39 |
|
40 |
gpu_stats = torch.cuda.get_device_properties(0)
|
@@ -44,13 +51,16 @@ print(f"(2) GPU = {gpu_stats.name}. Max memory = {max_memory} GB.")
|
|
44 |
print(f"{start_gpu_memory} GB of memory reserved.")
|
45 |
|
46 |
datasets = load_logical_reasoning_dataset(
|
47 |
-
data_path,
|
|
|
|
|
|
|
48 |
)
|
|
|
49 |
if len(sys.argv) > 1:
|
50 |
num = int(sys.argv[1])
|
51 |
if num > 0:
|
52 |
print(f"--- evaluating {num} entries")
|
53 |
-
# create new dataset exluding those idx
|
54 |
datasets["test"] = datasets["test"].select(range(num))
|
55 |
|
56 |
print_row_details(datasets["test"].to_pandas(), indices=[0, -1])
|
|
|
23 |
data_path = os.getenv("LOGICAL_REASONING_DATA_PATH")
|
24 |
results_path = os.getenv("LOGICAL_REASONING_RESULTS_PATH")
|
25 |
use_english_datasets = os.getenv("USE_ENGLISH_DATASETS") == "true"
|
26 |
+
using_p1 = os.getenv("USING_P1_PROMPT_TEMPLATE") == "true"
|
27 |
+
|
28 |
+
dtype = (
|
29 |
+
torch.bfloat16 if os.getenv("USE_BF16_FOR_INFERENCE") == "true" else torch.float16
|
30 |
+
)
|
31 |
|
32 |
print(model_name, adapter_name_or_path, load_in_4bit, data_path, results_path)
|
33 |
|
|
|
38 |
print(f"{start_gpu_memory} GB of memory reserved.")
|
39 |
|
40 |
model, tokenizer = load_model(
|
41 |
+
model_name,
|
42 |
+
load_in_4bit=load_in_4bit,
|
43 |
+
adapter_name_or_path=adapter_name_or_path,
|
44 |
+
dtype=dtype,
|
45 |
)
|
46 |
|
47 |
gpu_stats = torch.cuda.get_device_properties(0)
|
|
|
51 |
print(f"{start_gpu_memory} GB of memory reserved.")
|
52 |
|
53 |
datasets = load_logical_reasoning_dataset(
|
54 |
+
data_path,
|
55 |
+
tokenizer=tokenizer,
|
56 |
+
chinese_prompt=not use_english_datasets,
|
57 |
+
using_p1=using_p1,
|
58 |
)
|
59 |
+
|
60 |
if len(sys.argv) > 1:
|
61 |
num = int(sys.argv[1])
|
62 |
if num > 0:
|
63 |
print(f"--- evaluating {num} entries")
|
|
|
64 |
datasets["test"] = datasets["test"].select(range(num))
|
65 |
|
66 |
print_row_details(datasets["test"].to_pandas(), indices=[0, -1])
|
novel-translation/00_Data_Analysis.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/01_Qwen2-0.5B_Unsloth.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/02_Qwen2-1.5B_Unsloth.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/03_Qwen2-0.5B_1.5B-4bit.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/04_tune-small-no-flash-attn.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/05_tune-small-with-flash-attn.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/06_tune-small-py3.11.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/07_tune-lf-py3.11.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/07r2_tune-lf-py3.11.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/08_eval-lf-py3.11.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/08r2_eval-lf-py3.11.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
novel-translation/09_tune-lf-medium-py3.11.ipynb
DELETED
The diff for this file is too large to render.
See raw diff
|
|
scripts/eval-mgtv-llama3_8b.sh
CHANGED
@@ -24,10 +24,14 @@ export MODEL_PREFIX=llama3-8b_lora_sft_bf16
|
|
24 |
|
25 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p1.csv
|
26 |
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p1_full
|
|
|
|
|
27 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
28 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
29 |
|
30 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p2.csv
|
31 |
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p2_full
|
|
|
|
|
32 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
33 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
|
|
24 |
|
25 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p1.csv
|
26 |
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p1_full
|
27 |
+
export USING_P1_PROMPT_TEMPLATE=true
|
28 |
+
export START_EPOCH=1
|
29 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
30 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|
31 |
|
32 |
export LOGICAL_REASONING_RESULTS_PATH=results/$MODEL_PREFIX-p2.csv
|
33 |
export ADAPTER_PATH_BASE=llama-factory/saves/llama3-8b/lora/sft_bf16_p2_full
|
34 |
+
export USING_P1_PROMPT_TEMPLATE=false
|
35 |
+
export START_EPOCH=0
|
36 |
echo "Eval $MODEL_NAME with $ADAPTER_PATH_BASE"
|
37 |
python llm_toolkit/eval_logical_reasoning_all_epochs.py
|