`content_image_url` throws error in local vision model
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Bắt đầu với content_image_url và đường dẫn ContentImageRemote, sau đó theo dõi request qua chatlas/_chat.py và chatlas/_openai.py. So sánh request hình ảnh từ xa với ví dụ content_image_file đang hoạt động và tái hiện lệnh gọi Ollama llama3.2-vision; hoàn tất khi hình ảnh từ URL được chấp nhận mà không có lỗi đầu vào hình ảnh không hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hi- thanks for creating this package! I'm testing out some local vision workflows with ollama and llama3.2-vision. I seem to get an error when using the content_image_url function to fetch an image:
from chatlas import ChatOllama, content_image_url, content_image_file
# Initialize chat with ollama llama3.2-vision
chat = ChatOllama(model="llama3.2-vision")
# Using content_image_url
chat.chat(
"What do you see in this image?",
content_image_url("https://www.python.org/static/img/python-logo.png"),
echo="all"
)
Throws this error:
👤 User turn:
What do you see in this image?
<< 👤 other content >>
🌆 python-logo.png
🤖 Assistant turn:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "\.venv\lib\site-packages\chatlas\_chat.py", line 356, in chat
for _ in response:
File "\.venv\lib\site-packages\chatlas\_chat.py", line 1169, in __next__
chunk = next(self._generator)
File "\.venv\lib\site-packages\chatlas\_chat.py", line 833, in _chat_impl
for chunk in self._submit_turns(
File "\.venv\lib\site-packages\chatlas\_chat.py", line 884, in _submit_turns
response = self.provider.chat_perform(
File "\.venv\lib\site-packages\chatlas\_openai.py", line 247, in chat_perform
return self._client.chat.completions.create(**kwargs) # type: ignore
File "\.venv\lib\site-packages\openai\_utils\_utils.py", line 275, in wrapper
return func(*args, **kwargs)
File "\.venv\lib\site-packages\openai\resources\chat\completions.py", line 829, in create
return self._post(
File "\.venv\lib\site-packages\openai\_base_client.py", line 1280, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
File "\.venv\lib\site-packages\openai\_base_client.py", line 957, in request
return self._request(
File "\.venv\lib\site-packages\openai\_base_client.py", line 1061, in _request
raise self._make_status_error_from_response(err.response) from None
openai.BadRequestError: Error code: 400 - {'error': {'message': 'invalid image input', 'type': 'invalid_request_error', 'param': None, 'code': None}}
The content_image_url("https://www.python.org/static/img/python-logo.png") seems to fetch the image and store it as a ContentImageRemote object.
Also, this works fine with content_image_file function:
chat.chat(
"What do you see in this image?",
content_image_file("python-logo.png"),
echo="all"
)
👤 User turn:
What do you see in this image?
<< 👤 other content >>
🌆 Dw2mJn+YhmuMAAAAAElFTkSuQmCC
🤖 Assistant turn:
The image features the Python logo, which is a stylized representation of the
word "python" and serves as an emblem for the official implementation of the
Python programming language.
Key Features:
• Color scheme:
• Primary color: Blue
• Secondary color: Yellow
• Positioning: Left side of the screen
Purpose: The logo is used to represent the official Python programming
language, providing a clear visual identifier for users.
I've tested this with version 0.2.0 and version 0.2.1.dev1+g6e81eb3 of chatlas.
- Ngôn ngữ chính
- Python
- Star
- 179
- Fork
- 32
- Merge trung bình
- 1 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của posit-dev/chatlas
-
A streaming text delta that repeats everything streamed so far is missing from the recorded turnCó thể đã có người làm @cpsievert đã nhận 81 ngày trước. Đang mởai-triage:done Priority: Medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-triage:needs-review documentation
Độ khó 2/5 1-2 ngày Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
-
ai-triage:done Priority: Low
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của posit-dev/chatlas
Issue tương tự
-
bot-triaged module: decompositions module: edge cases module: int overflow module: primTorch oncall: pt2 triage review
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[TV SHOW]: Dynasty (1981)Đang mởcountry:US rating:6 request-theme type:TV SHOW
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
LizardByte/ThemerrDB#10501 · 1 bình luận ·
-
triage/confirmed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
agentscope-ai/agentscope#4563 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
comp/desktop desktop/chat P3 type/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
NousResearch/hermes-agent#164451 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
external integration integration-submission
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
langchain-ai/docs#8426 ·
Maintainer thường phản hồi trong vòng 1 ngày