Skip to content

Resolve messages formatting issues #13095

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion python/llm/src/ipex_llm/serving/fastchat/model_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ async def api_model_details(request: Request):

if args.gpus:
invalidInputError(len(args.gpus.split(",")) > args.num_gpus, f"Larger --num-gpus "
"({args.num_gpus}) than --gpus {args.gpus}!")
f"({args.num_gpus}) than --gpus {args.gpus}!")
os.environ["CUDA_VISIBLE_DEVICES"] = args.gpus

gptq_config = GptqConfig(
Expand Down
2 changes: 1 addition & 1 deletion python/llm/src/ipex_llm/transformers/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ def load_low_bit(cls,
else:
invalidInputError(False,
f'`torch_dtype` can be either `torch.dtype` or `"auto"`,'
'but received {torch_dtype}')
f'but received {torch_dtype}')
dtype_orig = model_class._set_default_torch_dtype(torch_dtype)

# Pretrained Model
Expand Down
6 changes: 3 additions & 3 deletions python/llm/src/ipex_llm/transformers/npu_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def from_pretrained(cls, *args, **kwargs):
max_prompt_len < max_context_len,
(
f"max_prompt_len ({max_prompt_len}) should be less"
" than max_context_len ({max_context_len})"
f" than max_context_len ({max_context_len})"
),
)
optimize_kwargs = {
Expand Down Expand Up @@ -553,7 +553,7 @@ def load_low_bit(cls, pretrained_model_name_or_path: str, *model_args, **kwargs)
invalidInputError(
False,
f'`torch_dtype` can be either `torch.dtype` or `"auto"`,'
"but received {torch_dtype}",
f"but received {torch_dtype}",
)
dtype_orig = model_class._set_default_torch_dtype(torch_dtype)

Expand Down Expand Up @@ -588,7 +588,7 @@ def load_low_bit(cls, pretrained_model_name_or_path: str, *model_args, **kwargs)
max_prompt_len < max_context_len,
(
f"max_prompt_len ({max_prompt_len}) should be less"
" than max_context_len ({max_context_len})"
f" than max_context_len ({max_context_len})"
),
)
from ipex_llm.transformers.npu_models.convert_mp import optimize_llm_pre
Expand Down
2 changes: 1 addition & 1 deletion python/llm/src/ipex_llm/transformers/npu_models/phi3.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def phi3_attention_forward(
invalidInputError(
False,
f"Attention mask should be of size {(bsz, 1, q_len, kv_seq_len)},"
" but is {attention_mask.size()}"
f" but is {attention_mask.size()}"
)
attn_weights = attn_weights + attention_mask

Expand Down
2 changes: 1 addition & 1 deletion python/llm/src/ipex_llm/transformers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def load_state_dict(checkpoint_file: Union[str, os.PathLike]):
except Exception as e:
invalidInputError(False,
f"Unable to load weights"
"from pytorch checkpoint file for '{checkpoint_file}' "
f"from pytorch checkpoint file for '{checkpoint_file}' "
f"at '{checkpoint_file}'. ")


Expand Down
2 changes: 1 addition & 1 deletion python/llm/src/ipex_llm/utils/lazy_load_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def load(offset: int, elm_count: int):
data = fp.read(size)
return torch.frombuffer(bytearray(data), dtype=dtype)
description = f'storage data_type={data_type} ' \
'path-in-zip={filename} path={self.zip_file.filename}'
f'path-in-zip={filename} path={self.zip_file.filename}'
return LazyStorage(load=load, kind=pid[1], description=description)

@staticmethod
Expand Down