Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions python/llm/dev/benchmark/perplexity/run_wikitext.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import argparse
import torch
from tqdm import tqdm
from datasets import concatenate_datasets, load_dataset
from datasets import load_dataset
from ipex_llm.utils.common import invalidInputError


Expand All @@ -34,6 +34,7 @@
parser.add_argument("--precision", type=str, default="sym_int4")
parser.add_argument("--use-cache", action="store_true")
parser.add_argument("--max_length", type=int, default=None)
parser.add_argument("--mixed_precision", action="store_true")
args = parser.parse_args()

if args.precision == "fp16": # ipex fp16
Expand All @@ -43,7 +44,7 @@
else: # ipex-llm
from ipex_llm.transformers import AutoModelForCausalLM
model = AutoModelForCausalLM.from_pretrained(args.model_path, load_in_low_bit=args.precision,
use_cache=args.use_cache, trust_remote_code=True)
use_cache=args.use_cache, trust_remote_code=True, mixed_precision= args.mixed_precision)
model = model.half()
model = model.to(args.device)
model = model.eval()
Expand Down