Skip to content

<video>查找判断问题BUG #5768

@cqray1990

Description

@cqray1990

Reminder

  • I have read the README and searched the existing issues.

System Info

content 内容有<\video> ,但是我的数据跟视频无关,这样导致出现错误:
[rank0]: ValueError: len(videos) is less than the number of <video> tokens.

意思就是content内容中就不能有<image>.<video>等字符,这样是不是不太好?

                while VIDEO_PLACEHOLDER in content:
                              if num_video_tokens >= len(video_grid_thw):
                                  raise ValueError("`len(videos)` is less than the number of {} tokens.".format(VIDEO_PLACEHOLDER))
              
                              content = content.replace(
                                  VIDEO_PLACEHOLDER,
                                  "<|vision_start|>{}<|vision_end|>".format(
                                      self.video_token * (video_grid_thw[num_video_tokens].prod() // merge_length)
                                  ),
                                  1,
                              )
                              num_video_tokens += 1

数据内容:
"from": "gpt",
"value": "Certainly! Here are simple examples for each point to help illustrate the concepts:\n\n1. Design trends:\na. Responsive design: A website that adjusts its layout for smartphones, tablets, and desktop computers.\nb. Minimalism: A website with a simple color scheme, limited images, and plenty of whitespace.\nc. Typography: Using a clear and legible font like Arial or Helvetica.\nd. UX/UI design: A shopping website with an easy-to-use search bar and a smooth checkout process.\ne. Dark mode: Twitter or YouTube offering a dark background with light text for nighttime viewing.\n2. Best practices:\na. Accessibility: Providing alt text for images so screen readers can describe them to visually impaired users.\nb. Mobile-friendliness: A website that loads quickly and is easy to navigate on a smartphone.\nc. Fast loading times: A news website that displays articles and images without making users wait.\nd. Clear navigation: A company website with a menu that clearly lists "About Us," "Products," and "Contact Us."\ne. SEO: A blog that uses relevant keywords and phrases to rank higher in Google search results.\n3. Technologies and tools:\na. HTML5: Using the

Reproduction

content 内容有<video> ,但是我的数据跟视频无关,这样导致出现错误:
[rank0]: ValueError: len(videos) is less than the number of

意思就是content内容中就不能有<\image>.<\video>等字符,这样是不是不太好?

                while VIDEO_PLACEHOLDER in content:
                              if num_video_tokens >= len(video_grid_thw):
                                  raise ValueError("`len(videos)` is less than the number of {} tokens.".format(VIDEO_PLACEHOLDER))
              
                              content = content.replace(
                                  VIDEO_PLACEHOLDER,
                                  "<|vision_start|>{}<|vision_end|>".format(
                                      self.video_token * (video_grid_thw[num_video_tokens].prod() // merge_length)
                                  ),
                                  1,
                              )
                              num_video_tokens += 1

"from": "gpt",
"value": "Certainly! Here are simple examples for each point to help illustrate the concepts:\n\n1. Design trends:\na. Responsive design: A website that adjusts its layout for smartphones, tablets, and desktop computers.\nb. Minimalism: A website with a simple color scheme, limited images, and plenty of whitespace.\nc. Typography: Using a clear and legible font like Arial or Helvetica.\nd. UX/UI design: A shopping website with an easy-to-use search bar and a smooth checkout process.\ne. Dark mode: Twitter or YouTube offering a dark background with light text for nighttime viewing.\n2. Best practices:\na. Accessibility: Providing alt text for images so screen readers can describe them to visually impaired users.\nb. Mobile-friendliness: A website that loads quickly and is easy to navigate on a smartphone.\nc. Fast loading times: A news website that displays articles and images without making users wait.\nd. Clear navigation: A company website with a menu that clearly lists "About Us," "Products," and "Contact Us."\ne. SEO: A blog that uses relevant keywords and phrases to rank higher in Google search results.\n3. Technologies and tools:\na. HTML5: Using the

Expected behavior

No response

Others

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    solvedThis problem has been already solved

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions