Spaces:
Build error
Build error
try float32 for inference
Browse files
llm_toolkit/eval_logical_reasoning.py
CHANGED
|
@@ -29,7 +29,13 @@ max_new_tokens = int(os.getenv("MAX_NEW_TOKENS", 16))
|
|
| 29 |
repetition_penalty = float(os.getenv("REPETITION_PENALTY", 1.0))
|
| 30 |
|
| 31 |
dtype = (
|
| 32 |
-
torch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
)
|
| 34 |
|
| 35 |
print(model_name, adapter_name_or_path, load_in_4bit, data_path, results_path)
|
|
|
|
| 29 |
repetition_penalty = float(os.getenv("REPETITION_PENALTY", 1.0))
|
| 30 |
|
| 31 |
dtype = (
|
| 32 |
+
torch.float32
|
| 33 |
+
if os.getenv("USE_FLOAT32_FOR_INFERENCE") == "true"
|
| 34 |
+
else (
|
| 35 |
+
torch.bfloat16
|
| 36 |
+
if os.getenv("USE_BF16_FOR_INFERENCE") == "true"
|
| 37 |
+
else torch.float16
|
| 38 |
+
)
|
| 39 |
)
|
| 40 |
|
| 41 |
print(model_name, adapter_name_or_path, load_in_4bit, data_path, results_path)
|
scripts/eval-mgtv-best.sh
CHANGED
|
@@ -13,17 +13,17 @@ cat /etc/os-release
|
|
| 13 |
lscpu
|
| 14 |
grep MemTotal /proc/meminfo
|
| 15 |
|
| 16 |
-
|
| 17 |
#cd ../LLaMA-Factory && pip install -e .[torch,bitsandbytes]
|
| 18 |
|
| 19 |
-
pip install transformers==4.41.2
|
| 20 |
-
|
| 21 |
-
export USING_LLAMA_FACTORY=true
|
| 22 |
|
| 23 |
export MODEL_NAME=internlm/internlm2_5-7b-chat-1m
|
| 24 |
export ADAPTER_NAME_OR_PATH=inflaton-ai/InternLM_2_5-7b_LoRA-Adapter
|
| 25 |
export LOGICAL_REASONING_DATA_PATH=datasets/mgtv
|
| 26 |
export LOGICAL_REASONING_RESULTS_PATH=results/mgtv-results_internlm_best.csv
|
|
|
|
| 27 |
|
| 28 |
echo "Eval $MODEL_NAME with $ADAPTER_NAME_OR_PATH"
|
| 29 |
python llm_toolkit/eval_logical_reasoning.py
|
|
|
|
| 13 |
lscpu
|
| 14 |
grep MemTotal /proc/meminfo
|
| 15 |
|
| 16 |
+
pip install -r requirements.txt
|
| 17 |
#cd ../LLaMA-Factory && pip install -e .[torch,bitsandbytes]
|
| 18 |
|
| 19 |
+
# pip install transformers==4.41.2
|
| 20 |
+
# export USING_LLAMA_FACTORY=true
|
|
|
|
| 21 |
|
| 22 |
export MODEL_NAME=internlm/internlm2_5-7b-chat-1m
|
| 23 |
export ADAPTER_NAME_OR_PATH=inflaton-ai/InternLM_2_5-7b_LoRA-Adapter
|
| 24 |
export LOGICAL_REASONING_DATA_PATH=datasets/mgtv
|
| 25 |
export LOGICAL_REASONING_RESULTS_PATH=results/mgtv-results_internlm_best.csv
|
| 26 |
+
export USE_FLOAT32_FOR_INFERENCE=true
|
| 27 |
|
| 28 |
echo "Eval $MODEL_NAME with $ADAPTER_NAME_OR_PATH"
|
| 29 |
python llm_toolkit/eval_logical_reasoning.py
|