Skip to content
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

[BUG/Help] <title>运行api.py报错 #679

Open
1 task done
cqray1990 opened this issue Jun 1, 2024 · 0 comments
Open
1 task done

[BUG/Help] <title>运行api.py报错 #679

cqray1990 opened this issue Jun 1, 2024 · 0 comments

Comments

@cqray1990
Copy link

cqray1990 commented Jun 1, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

curl -X POST "http://0.0.0.0:8000" -H 'Content-Type: application/json' -d '{"promt": "

科目区间单价应缴金额上次
公费2024.2.26-2024.3.260.707114368.27167311698520320
2024.2.26-2024.3.266.351574.81252412772248
大写壹万伍仟玖佰肆拾叁元零柒分
合计15943.07
","history":[]}'

传入以上数据html文本的时候,页面自动渲染出来表格了,实际是一个html的文本:报以下错误,json解析不了,不能传html文本?只是一个文本而已为什么不能解析?传其他的文本就可以跑

File "/home/user/chatglm/llm_ki/fastapi_demo.py", line 41, in create_item
json_post_raw = await request.json()
File "y/lib/python3.10/site-packages/starlette/requests.py", line 252, in json
self._json = json.loads(body)
File "y/lib/python3.10/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "y/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "y/lib/python3.10/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 18 (char 17)

422 Unprocessable Entity

Expected Behavior

No response

Steps To Reproduce

curl -X POST "http://0.0.0.0:8000" -H 'Content-Type: application/json' -d '{"promt": """

科目区间单价应缴金额上次
公费2024.2.26-2024.3.260.707114368.27167311698520320
2024.2.26-2024.3.266.351574.81252412772248
大写壹万伍仟玖佰肆拾叁元零柒分
合计15943.07
""","history":[]}'

Environment

- OS:
- Python:3.10
- Transformers:4.40.0
- PyTorch:2.1
- CUDA Support (`python -c "import torch; 12.1 print(torch.cuda.is_available())"`) :

Anything else?

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant