Repository navigation
Conversation
Set an honest package User-Agent in the independent Llava15 and MTMD image loaders. Preserve data/file handling and HTTP errors. Fixes abetlen#1229. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Use a local HTTP server to test direct and redirected package identity, exact payloads and HTTP errors for both loaders. Preserve data and file URLs without native vision fixtures. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Record the user-visible image request compatibility change under Unreleased. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Complete the contribution guide's changelog format with abetlen#2411. Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1229.
Send
User-Agent: llama-cpp-pythonwhen fetching remote images inLlava15ChatHandlerand the independentMTMDChatHandlerloader. The Llava-derived handlers inherit the same change. This identifies the package instead of relying on urllib's defaultPython-urllib/...user agent; it does not impersonate a browser or claim to fix every server's HTTP 403 policy.The change only wraps the URL in
urllib.request.Requestbefore opening it. Data-URI decoding is unchanged. File URLs, response bytes and HTTP errors retain their existing behavior. Redirect handling stays with urllib; the added regression checks HTTP 302, not every redirect status.Validation
python -m pytest tests -q: 36 passed, no skips (26 existing tests plus 10 new cases), including the existing native/model-backed suite.ruff check llama_cpp tests,ruff format --check llama_cpp tests, andgit diff --check: passed.Environment: Python 3.11.17, Linux x86_64 CPU, GCC 11.4, CMake 3.22.1; pinned llama.cpp
7d7f0287530bc8981690f361d8c1627dbae1c99a, built withGGML_NATIVE=OFF,GGML_OPENMP=OFF,GGML_BLAS=OFF. No new dependency or native-code change. The added tests exercise image fetching, not multimodal image decoding or vision inference.