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

Fix: Ensure Full Image Path Resolution for LLMs #3955

Closed
wants to merge 5 commits into from

Conversation

Cristhianzl
Copy link
Member

@Cristhianzl Cristhianzl commented Sep 27, 2024

📝 (image.py): import user_cache_dir from platformdirs to create a cache directory for image files
🐛 (image.py): fix file_path assignment to include cache_dir path for image verification

  • Problem
    The LLMs were unable to process images due to issues locating the relative path. This caused the image to not be interpreted or processed correctly by the LLMs.

  • Solution
    This PR introduces a finder that resolves the full path of the image, ensuring that the LLM can correctly locate and interpret the image. By converting the relative image path to an absolute path, we eliminate the path resolution issue and allow the LLM to process images as intended.

…he directory for image files

🐛 (image.py): fix file_path assignment to include cache_dir path for image verification
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. bug Something isn't working labels Sep 27, 2024
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3955.dmtpw4p5recq1.amplifyapp.com

@Cristhianzl Cristhianzl changed the title fix fix: get the full path for image checks Sep 27, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Sep 27, 2024
@Cristhianzl Cristhianzl changed the title fix: get the full path for image checks Fix: Ensure Full Image Path Resolution for LLMs Sep 27, 2024
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Sep 27, 2024
Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @Cristhianzl

I don't think this is correct. We should try to understand why file_path isn't correct any more.

…prove code readability

📝 (message.py): Add synchronous version of get_file_paths function to improve performance
📝 (service.py): Implement build_full_path method to construct full file path in the local storage
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Oct 1, 2024
@Cristhianzl
Copy link
Member Author

Hey @Cristhianzl

I don't think this is correct. We should try to understand why file_path isn't correct any more.

you are right.
I found the error. It is between my chair and my computer. It was missing a condition when I fixed the images sent inside the components.

please check this PR #3980

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants