Find answers from the community

Updated last year

Hey I tried to generate descriptions of

Hey I tried to generate descriptions of images using GPT 4 Vision and followed this tutorial : https://docs.llamaindex.ai/en/stable/examples/multi_modal/gpt4v_multi_modal_retrieval.html

But it's not working as I'm getting an error (see in thread)
A
2 comments
Plain Text
  File "SomePath\medias\generate_description.py", line 33, in generate_description_image
    return openai_mm_llm.complete(prompt=PROMPT.format(path=path), image_documents=image_documents).text
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "SomePath\venv\Lib\site-packages\llama_index\multi_modal_llms\openai.py", line 160, in complete
    response = self._client.chat.completions.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "SomePath\venv\Lib\site-packages\openai\_utils\_utils.py", line 299, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "SomePath\venv\Lib\site-packages\openai\resources\chat\completions.py", line 598, in create
    return self._post(
           ^^^^^^^^^^^
  File "SomePath\venv\Lib\site-packages\openai\_base_client.py", line 1055, in post
    return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "SomePath\venv\Lib\site-packages\openai\_base_client.py", line 834, in request
    return self._request(
           ^^^^^^^^^^^^^^
  File "SomePath\venv\Lib\site-packages\openai\_base_client.py", line 877, in _request
    raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'Invalid image.', 'type': 'invalid_request_error', 'param': None, 'code': None}}

Process finished with exit code 1
Nevermind, images must be published somewhere
Add a reply
Sign up and join the conversation on Discord