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

Enable qwen2-vl multimodal input on v0.6.1 #43

Merged
merged 8 commits into from
Oct 11, 2024

Conversation

hzjane
Copy link
Collaborator

@hzjane hzjane commented Oct 9, 2024

Refer to this issue. We need to remove self.rope_scaling["type"] = "default". "fp8" is recommended to use.

pip install transformers==4.45.1
# vim /usr/local/lib/python3.11/dist-packages/transformers/models/qwen2_vl/configuration_qwen2_vl.py line 241
if self.rope_scaling["type"] == "mrope":
    #self.rope_scaling["type"] = "default"
    pass

online test

curl http://localhost:7999/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "Qwen2-VL-7B-Instruct",
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "type": "text",
            "text": "What is in the image?"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "http://farm6.staticflickr.com/5268/5602445367_3504763978_z.jpg"
            }
          }
        ]
      }
    ],
    "max_tokens": 128,
    "temperature": 0.1,
    "top_p": 0.001,
    "repetition_penalty": 1.05
  }'

If encounter duplicate output problems, try to increaserepetition_penalty to 1.99.

@hzjane hzjane changed the title Enable qwen2-vl multimodal input Enable qwen2-vl multimodal input on v0.6.1 Oct 9, 2024
Copy link
Collaborator

@xiangyuT xiangyuT left a comment

Choose a reason for hiding this comment

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

LGTM

@xiangyuT xiangyuT merged commit 32c883f into analytics-zoo:061_test_0924 Oct 11, 2024
xiangyuT pushed a commit that referenced this pull request Oct 16, 2024
* Enable qwen2-vl multimodal input on v0.6.1 (#43)

* enable mrope model

* update minicpm

* update utils

* update qwen2_vl

* update

* update

* enable parallel multimodal input

* update

* remove error
@guang11644331
Copy link

it's work ^_^!

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.

3 participants