swarms_wd@Kyes-MacBook-Pro llama3 % /usr/local/bin/python3 /Users/swarms_wd/Desktop/research/swarms-cloud/examples/intern_example.py
Traceback (most recent call last):
File "/Users/swarms_wd/Desktop/research/swarms-cloud/examples/intern_example.py", line 12, in <module>
chat_response = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/openai/_utils/_utils.py", line 277, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 590, in create
return self._post(
^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/openai/_base_client.py", line 1240, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/openai/_base_client.py", line 921, in request
return self._request(
^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/openai/_base_client.py", line 1020, in _request
raise self._make_status_error_from_response(err.response) from None
openai.NotFoundError: Internal Error - fetching model, {"detail":"Not Found"}
swarms_wd@Kyes-MacBook-Pro llama3 %
from dotenv import load_dotenv
from openai import OpenAI
load_dotenv()
openai_api_key = "sk-"
openai_api_base = "https://api.swarms.world/v1"
model = "internlm-xcomposer2-4khd"
client = OpenAI(api_key=openai_api_key, base_url=openai_api_base)
# Note that this model expects the image to come before the main text
chat_response = client.chat.completions.create(
model=model,
messages=[
{
"role": "user",
"content": [
{
"type": "image_url",
"image_url": {
"url": "https://home-cdn.reolink.us/wp-content/uploads/2022/04/010345091648784709.4253.jpg",
},
},
{
"type": "text",
"text": "What is the most dangerous object in the image?",
},
],
}
],
temperature=0.1,
max_tokens=5000,
)
print("Chat response:", chat_response)
```
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too