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

again json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #36

Open
LexiestLeszek opened this issue Dec 9, 2023 · 3 comments

Comments

@LexiestLeszek
Copy link

I deployed flask app to vercel and once i submit a form, it returns internal server error:

[ERROR] 2023-12-09T11:10:22.812Z 2caf4f59-d74e-48db-ae5a-af1126340cad Exception on / [POST]
Traceback (most recent call last):
File "/var/task/flask/app.py", line 1455, in wsgi_app
response = self.full_dispatch_request()
File "/var/task/flask/app.py", line 869, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/var/task/flask/app.py", line 867, in full_dispatch_request
rv = self.dispatch_request()
File "/var/task/flask/app.py", line 852, in dispatch_request
return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
File "./main.py", line 26, in index
perplexity = Perplexity()
File "/var/task/perplexity/perplexity.py", line 28, in init
self.sid: str = self._get_sid()
File "/var/task/perplexity/perplexity.py", line 80, in _get_sid
return loads(self.session.get(
File "/var/lang/lib/python3.9/json/init.py", line 346, in loads
return _default_decoder.decode(s)
File "/var/lang/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/var/lang/lib/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

how to fix it?

@LexiestLeszek
Copy link
Author

Why does it work when i run it locally, but doesn't work when I deploy my project on Vercel?

@laserman2000
Copy link

I believe this is an issue with Cloudflare. Maybe we could use some ideas from https://github.com/Erol444/gpt4-openai-api/blob/main/gpt4_openai/driver.py to bypass it?

@itsklimov
Copy link

I have the same

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

3 participants