opengear-project / GEAR

GEAR: An Efficient KV Cache Compression Recipefor Near-Lossless Generative Inference of LLM
MIT License
128 stars 10 forks source link

UnicodeEncodeError when writing non-ASCII characters to a file #15

Closed mohsenhariri closed 1 month ago

mohsenhariri commented 1 month ago

Description

I encountered a UnicodeEncodeError when trying to write non-ASCII characters to a file. Below is a snippet of the code causing the issue:

handle.write(
UnicodeEncodeError: 'ascii' codec can't encode character '\u2019' in position 8: ordinal not in range(128)

Steps to Reproduce

python evaluation_gsm8k.py --model mistralai/Mistral-7B-v0.1 --prompt_file gsm8k_prompt_original.txt --compress_method KIVI_V2

Environment Python 3.10.14 CUDA: 12.1 OS: Red Hat Enterprise Linux VERSION="8.10 (Ootpa)"

HaoKang-Timmy commented 1 month ago

Thanks for the help!