Skip to content

[Question]:在进行图片的视觉分析时,使用的是相对路径加载图片的base64? #31

@LiZiTi

Description

@LiZiTi

Do you need to ask a question?

  • I have searched the existing question and discussions and this question is not already answered.
  • I believe this is a legitimate question, not just a bug or feature request.

Your Question

代码文件:modelprocessors.py 247 行的函数process_multimodal_content:
`
image_path = content_data.get("img_path")
captions = content_data.get("img_caption", [])
footnotes = content_data.get("img_footnote", [])

        # Build detailed visual analysis prompt
        vision_prompt = PROMPTS["vision_prompt"].format(
            entity_name=entity_name
            if entity_name
            else "unique descriptive name for this image",
            image_path=image_path,
            captions=captions if captions else "None",
            footnotes=footnotes if footnotes else "None",
        )

        # If image path exists, try to encode image
        image_base64 = ""
        if image_path and Path(image_path).exists():
            image_base64 = self._encode_image_to_base64(image_path)

`

我发现传递进来的content_data中图片的路径是相对路径,而且函数process_multimodal_content也没有地方去获取存储图片的根路径,导致无法成功加载图片的base64。

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions