From 53b599723c34cc8b043cce01d9ca641153d5211d Mon Sep 17 00:00:00 2001 From: YIYANGCAI Date: Wed, 2 Aug 2023 11:32:23 +0800 Subject: [PATCH 1/2] init commit Signed-off-by: YIYANGCAI --- .../quantization/ptq_weight_only/run-gptq-llm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py b/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py index eea3bfd9d58..b246f04f215 100644 --- a/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py +++ b/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py @@ -174,7 +174,8 @@ def skip(*args, **kwargs): results = lm_evaluate( model="hf-causal", - model_args=f'pretrained="{args.model_name_or_path}",tokenizer="{args.model_name_or_path}",dtype=float32', + # model_args=f'pretrained="{args.model_name_or_path}",tokenizer="{args.model_name_or_path}",dtype=float32', + model_args='pretrained='+args.model_name_or_path+',tokenizer='+args.model_name_or_path+',dtype=float32', user_model=q_model.to(DEV), tasks=["lambada_openai"], device=DEV.type, batch_size=4 From fa218079853df36bb6f3881c961bcbaf32e4b4f6 Mon Sep 17 00:00:00 2001 From: YIYANGCAI Date: Wed, 2 Aug 2023 13:07:32 +0800 Subject: [PATCH 2/2] remove commented contents. Signed-off-by: YIYANGCAI --- .../quantization/ptq_weight_only/run-gptq-llm.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py b/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py index b246f04f215..afe48d7c147 100644 --- a/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py +++ b/examples/pytorch/nlp/huggingface_models/language-modeling/quantization/ptq_weight_only/run-gptq-llm.py @@ -161,7 +161,7 @@ def skip(*args, **kwargs): # ) # q_model = quantization.fit(model, conf, calib_dataloader=dataloader,) - # method 2: directly use build-in function, for some models like falcon, please use this function + # method 2: directly use INC build-in function, for some models like falcon, please use this function conf = { ".*":{ 'wbits': args.wbits, # 1-8 bits @@ -174,19 +174,8 @@ def skip(*args, **kwargs): results = lm_evaluate( model="hf-causal", - # model_args=f'pretrained="{args.model_name_or_path}",tokenizer="{args.model_name_or_path}",dtype=float32', model_args='pretrained='+args.model_name_or_path+',tokenizer='+args.model_name_or_path+',dtype=float32', user_model=q_model.to(DEV), tasks=["lambada_openai"], device=DEV.type, batch_size=4 ) - - # datasets = ['wikitext2'] - - # for dataset in datasets: - # dataloader, testloader = get_loaders( - # dataset, seed=0, model=args.model_name_or_path, seqlen=model.seqlen - # ) - # print(dataset, flush=True) - # ppl = eval_ppl_with_gptq(model, testloader, device) - # results.update({dataset: ppl})