Add Microsoft KOSMOS-2.5 model support to VLM evaluation application#1
Draft
Copilot wants to merge 3 commits into
Draft
Add Microsoft KOSMOS-2.5 model support to VLM evaluation application#1Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Co-authored-by: pexus <1809523+pexus@users.noreply.github.com>
Co-authored-by: pexus <1809523+pexus@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] I want you to look at this repo, that was created for evaluating various Vision language models. I see there is a new mode out there on huggingface - KOSMOS 2.5 https://huggingface.co/models?search=microsoft/kosmos-2.5 - I want to integrate this mode s...
Add Microsoft KOSMOS-2.5 model support to VLM evaluation application
Aug 28, 2025
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.
This PR adds support for Microsoft's KOSMOS-2.5 vision-language model to the VLM evaluation application, enabling users to test and compare this model alongside the existing options.
Changes Made
Model Integration
MODEL_CHOICESdictionary to include"microsoft/kosmos-2.5": "main"Kosmos2ForConditionalGenerationandKosmos2Processorfrom the transformers libraryload_model_and_processor()function with proper device mapping and authenticationextract_text_from_image()function with appropriate prompt formatting using the<grounding>tag formatDocumentation Updates
Technical Implementation Details
The KOSMOS-2.5 integration follows the established patterns in the codebase:
UI Changes
The KOSMOS-2.5 model is now available in the model selection dropdown alongside all existing models:
Testing
The implementation is minimal and surgical, adding only the necessary code to support KOSMOS-2.5 without modifying existing functionality for other models.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
huggingface.copython -c import requests; print(requests.get('REDACTED').json())(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.