Skip to content

Failed to find image for token at index XXX for Qwen2-VL-7B #464

Open
@jsoma

Description

@jsoma

Which version of LM Studio?
0.3.10-6 (and earlier)

Which operating system?
macOS Sonoma

What is the bug?
Repeated Failed to find image for token at index XXX errors when using Qwen2-VL-7B models such as qwen2-vl-7b-instruct and allenai_olmocr-7b-0225-preview. Doesn't happen for every image or every prompt, though. Once it hits that error it hangs.

Logs

2025-02-26 21:11:37 [DEBUG] About to embed image
2025-02-26 21:11:39 [DEBUG] BeginProcessingPrompt
2025-02-26 21:11:40 [DEBUG] PromptProcessing: 64.0801
2025-02-26 21:11:41 [DEBUG] Failed to find image for token at index 280
2025-02-26 21:11:41 [DEBUG] PromptProcessing: 99.8748

Token failure index is the same across the two models mentioned above.

To Reproduce

Prompt:

Below is the image of one page of a document, as well as some raw textual content that was previously extracted for it. Just return the plain text representation of this document as if you were reading it naturally.
Do not hallucinate.
RAW_TEXT_START
Page dimensions: 612.0x792.0
[107x583]Chapter 2
[107x533]Mathematical Induction:
[107x503]"And so on . . . "
[107x444]2.1 Introduction
[107x421]This chapter marks our first big step toward investigating mathematical proofs
[107x410]more throughly and learning to construct our own. It is also an introduction
[107x398]to the first significant
[107x398]proof technique
[209x398]we will see. As we describe below,
[107x386]this chapter is meant to be an appetizer, a first taste, of what
[107x386]mathematical
[107x374]induction
[107x374]is and how to use it. A couple of chapters from now, we will we be
[107x362]able to rigorously define induction and
[107x362]prove
[278x362]that this technique is mathemati-
[107x350]cally valid. That's right, we'll actually prove how and why it works! For now,
[107x338]though, we'll continue our investigation of some interesting mathematical puz-
[107x326]zles, with these particular problems hand-picked by us for their use of inductive
[107x314]techniques.
[107x283]2.1.1 Objectives
[107x264]The following short sections in this introduction will show you how this chapter
[107x252]fits into the scheme of the book. They will describe how our previous work
[107x240]will be helpful, they will motivate why we would care to investigate the topics
[107x228]that appear in this chapter, and they will tell you our goals and what you
[107x216]should keep in mind while reading along to achieve those goals. Right now,
[107x204]we will summarize the main objectives of this chapter for you via a series of
[107x192]statements. These describe the skills and knowledge you should have gained by
[107x180]the conclusion of this chapter. The following sections will reiterate these ideas
[107x168]in more detail, but this will provide you with a brief list for future reference.
[107x156]When you finish working through this chapter, return to this list and see if you
[107x144]understand all of these objectives. Do you see why we outlined them here as
[107x132]being important? Can you define all the terminology we use? Can you apply
[107x120]the techniques we describe?
[271x95]101

RAW_TEXT_END

With the following image attached:

Image

It works fine with that image and "hello," though.

Metadata

Metadata

Assignees

No one assigned

    Labels

    more-info-neededNeed more information to diagnose the problem

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions