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

GPT response Issue #9

Open
marcelklopper opened this issue Dec 13, 2023 · 3 comments
Open

GPT response Issue #9

marcelklopper opened this issue Dec 13, 2023 · 3 comments

Comments

@marcelklopper
Copy link

marcelklopper commented Dec 13, 2023

I am Having the following issue:

Got 7 frames from video
Process-90: prompting GPT-4v
Process-89: GPT response {'id': 'chatcmpl-8VF2rf3HoYVZZfy3Wvwk8OJbcyOMi', 'object': 'chat.completion', 'created': 1702456693, 'model': 'gpt-4-1106-vision-preview', 'usage': {'prompt_tokens': 283, 'completion_tokens': 135, 'total_tokens': 418}, 'choices': [{'message': {'role': 'assistant', 'content': "It appears that you've shared a series of images from a security camera or monitoring system showing a view of what looks like a residential area. The images are time-stamped, indicating that they were taken within seconds of each other. There's a patterned paved driveway or courtyard with trees and a wooden fence at the far end. \n\nIn the second image, a person carrying a bag or bucket enters the frame from the right side. In the third image, the same person continues to walk across the area, still carrying the item, and a small dog is visible following them in the background. It looks like a regular day-to-day moment captured on a home security system."}, 'finish_details': {'type': 'stop', 'stop': '<|fim_suffix|>'}, 'index': 0}]}
Process-89: Error processing video for event 1702456682.852495-onmarj
Traceback (most recent call last):
File "/app/./mqtt_client.py", line 304, in process_message
result = json.loads(json_str)
^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/init.py", line 346, in loads
return _default_decoder.decode(s)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/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)

I think this is probably because I am using gpt-4-1106-vision-preview and not gpt-4-vision-preview

I can't seem to find the gpt-4-vision-preview model on my openAI account or at least I don't have access to it.

I will also try see what I can do from my end but any help is much appreciated.

@mhaowork
Copy link
Owner

@marcelklopper Sorry for the late reply. I have been on a vacation recently. The program expects a valid json in OpenAI API response. Did you customize the prompt? If not, this should be a transient error. Otherwise, please make sure your prompt has instructions for the model to return json.

@marcelklopper
Copy link
Author

No worries, hope you have a cheerful festive season. I am also away atm. I have not changed the prompt from the default. I will try play with a custom prompt to see if it helps to get a valid json response. will keep you posted.

@ttopholm
Copy link

ttopholm commented Feb 2, 2024

@marcelklopper if you have used the default config, it contains a prompt, try delete that.

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