Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

move environment variable setting into eval function (#829)

Xin He2a1409db945b
diff --git a/auto_round/script/llm.py b/auto_round/script/llm.py
index 33379976a..f489bd12e 100644
--- a/auto_round/script/llm.py
+++ b/auto_round/script/llm.py
@@ -42,8 +42,6 @@ from auto_round.utils import (
set_cuda_visible_devices,
)
-os.environ["TOKENIZERS_PARALLELISM"] = "false"
-
class BasicArgumentParser(argparse.ArgumentParser):
@@ -978,12 +976,12 @@ def eval_task_by_task(
def eval_with_vllm(args):
import time
- st = time.time()
-
from lm_eval import evaluator # pylint: disable=E0401
from lm_eval.models.vllm_causallms import VLLM # pylint: disable=E0401
from lm_eval.utils import make_table # pylint: disable=E0401
+ st = time.time()
+ os.environ["TOKENIZERS_PARALLELISM"] = "false"
device_str, _ = get_device_and_parallelism(args.device)
eval_model_dtype = get_model_dtype(args.eval_model_dtype, "auto")
if (batch_size := args.eval_bs) is None: