gpt4 book ai didi

openai-api - 字符 '\u201c' 在哪里?

转载 作者:行者123 更新时间:2023-12-02 05:49:23 25 4
gpt4 key购买 nike

我正在尝试在 chatgpt 上运行微调,但它一直使我的 JSONL 文件出错,并出现以下错误

... <some more error stack>
File "/usr/local/Cellar/python@3.11/3.11.3/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py", line 1256, in putheader
values[i] = one_value.encode('latin-1')
^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'latin-1' codec can't encode character '\u201c' in position 7: ordinal not in range(256)

这是我传递给脚本的 JSONL 文件的内容。

{"prompt":"Why is my AC not working? ->","completion":" There can be several reasons why your AC is not working. Here are a few things you can check:\n    1. Power supply: Make sure that the AC unit is receiving power. Check the circuit breaker to ensure it hasn't tripped or the fuse hasn't blown.\n    2. Thermostat: Check the thermostat to make sure it's set to the desired temperature and that it's on the correct setting (e.g., 'cool' instead of 'heat').\n    3. Air filter: Check the air filter and replace it if it's dirty. A clogged air filter can prevent the AC from working efficiently.\n    4. Refrigerant level: If your AC unit is not blowing cold air, it could be due to a low refrigerant level. You may need to have a professional recharge the refrigerant.\n    5. Outdoor unit: Check the outdoor unit to ensure that it's clear of debris and there's nothing obstructing the airflow.\nIf none of these troubleshooting steps work, it may be time to call a professional AC technician to diagnose and fix the issue."}

搜索后发现\u201c 是左双引号。它在我的文件中的什么位置以及为什么会出错?文件也以utf-8字符集存储。

尝试使用 JSON 和 Pandas 库进行各种转换,但均无济于事。

最佳答案

我设置的 API key 有错误的引号。

关于openai-api - 字符 '\u201c' 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76278508/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com