Skip to content

feat: add LFM2-VL model support - #11

Open
reacher-z wants to merge 1 commit into
InternScience:mainfrom
reacher-z:feat/lfm2-vl-support
Open

feat: add LFM2-VL model support#11
reacher-z wants to merge 1 commit into
InternScience:mainfrom
reacher-z:feat/lfm2-vl-support

Conversation

@reacher-z

Copy link
Copy Markdown

Summary

  • add a Transformers adapter for the LiquidAI LFM2-VL model family
  • register the 450M, 1.6B, and 3B checkpoints in supported_VLM
  • preserve interleaved image/text inputs and use the official multimodal apply_chat_template path
  • support CUDA, MPS, CPU, and an optional device_map
  • add focused regression tests for message construction, MM-IFEval ordering, generation slicing, and model placement

This is a new foundation-model integration, one of the major-contribution categories described in the SciEvalKit README.

Implementation follows the official model card inference API: https://huggingface.co/LiquidAI/LFM2-VL-450M

Validation

  • python3 -m pytest -q tests/test_lfm2_vl.py — 3 passed
  • python3 -m py_compile scieval/config.py scieval/vlm/__init__.py scieval/vlm/liquid.py tests/test_lfm2_vl.py
  • pre-commit hooks pass for the new adapter, import, and tests
  • real CPU smoke test with transformers==4.57.1, torch==2.8.0, and the public LiquidAI/LFM2-VL-450M weights: loaded in 60.98s and generated in 4.85s; for assets/radar.png and the prompt “What kind of chart is shown? Answer briefly.” the adapter returned Polar.

The full config file has pre-existing lint violations outside this diff, so validation also included git diff --check and compilation of the modified config.

AI assistance disclosure

OpenAI Codex assisted with implementation, tests, and PR drafting. I ran and inspected the tests and real-model smoke inference before submission.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant