Skip to content

🐛 [TZF-260067]: Fix 'bytes.seek' error in image search with remote images #67

@Ravindrayadav04

Description

@Ravindrayadav04

Describe the bug

While performing image search using SigLIP embeddings, the API fails with:
'bytes' object has no attribute 'seek'
This occurs both in local and production environments

why this is happening (root cause )

  • SigLIP attempts to automatically load images from image_uri
  • For S3/CDN URLs, the loader returns raw bytes
  • PIL (Image.open) expects a file-like object
  • This leads to failure when .seek() is called internally

What did you expect to happen?

The image search API should successfully process images from S3/CDN URLs, generate embeddings using SigLIP, and return relevant search results without errors.

Specifically:

  • Images should be properly loaded as valid PIL image objects
  • Embeddings should be generated without failure
  • The search endpoint should return similar images based on the query

No runtime errors (such as 'bytes' object has no attribute 'seek') should occur during this process.

Sample code link

No response

System info

No response

What browsers are you seeing the problem on?

No response

Relevant log output

Assignment

This issue is free for anyone to take

Before submitting

  • I've made research efforts and searched the documentation
  • I've searched for existing issues

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdevelopmentBranch created for this issue

Projects

Status

Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions