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

Make sure image decode -> data URL works for large images also #416

Open
ashwinb opened this issue Nov 10, 2024 · 0 comments
Open

Make sure image decode -> data URL works for large images also #416

ashwinb opened this issue Nov 10, 2024 · 0 comments

Comments

@ashwinb
Copy link
Contributor

ashwinb commented Nov 10, 2024

This seems to break if client uploads image via URL.

  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/llama_stack/providers/inline/inference/meta_reference/inference.py", line 421, in request_with_localized_media
    m.content = await _convert_content(m.content)
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/llama_stack/providers/inline/inference/meta_reference/inference.py", line 415, in _convert_content
    return [await _convert_single_content(c) for c in content]
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/llama_stack/providers/inline/inference/meta_reference/inference.py", line 415, in <listcomp>
    return [await _convert_single_content(c) for c in content]
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/llama_stack/providers/inline/inference/meta_reference/inference.py", line 408, in _convert_single_content
    url = await convert_image_media_to_url(content, download=True)
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/llama_stack/providers/utils/inference/prompt_adapter.py", line 77, in convert_image_media_to_url
    r = await client.get(media.image.uri)
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/httpx/_client.py", line 1814, in get
    return await self.request(
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/httpx/_client.py", line 1572, in request
    request = self.build_request(
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/httpx/_client.py", line 346, in build_request
    url = self._merge_url(url)
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/httpx/_client.py", line 376, in _merge_url
    merge_url = URL(url)
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/httpx/_urls.py", line 117, in __init__
    self._uri_reference = urlparse(url, **kwargs)
  File "/home/xiyan/.conda/envs/llamastack-meta-reference-gpu/lib/python3.10/site-packages/httpx/_urlparse.py", line 158, in urlparse
    raise InvalidURL("URL too long")
httpx.InvalidURL: URL too long

Originally posted by @yanxi0830 in #376 (comment)

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

No branches or pull requests

1 participant