推理提供商文档
Cohere
加入 Hugging Face 社区
并获得增强的文档体验
开始使用
Cohere
您可以在此处找到所有支持的 Cohere 模型
Cohere 将尖端的语料库模型、高级检索和为现代企业量身定制的 AI 工作空间整合到一个安全平台中。
Cohere 是第一家直接在 Hub 上共享和提供其模型作为推理提供商的模型创建者。
支持的任务
聊天补全 (LLM)
了解更多关于聊天补全 (LLM) 的信息,请点击这里。
语言
客户端
提供商
import os
from openai import OpenAI
client = OpenAI(
base_url="https://router.huggingface.co/v1",
api_key=os.environ["HF_TOKEN"],
)
completion = client.chat.completions.create(
model="CohereLabs/aya-expanse-32b:cohere",
messages=[
{
"role": "user",
"content": "What is the capital of France?"
}
],
)
print(completion.choices[0].message)聊天补全 (VLM)
了解更多关于聊天补全 (VLM) 的信息,请点击这里。
语言
客户端
提供商
import os
from openai import OpenAI
client = OpenAI(
base_url="https://router.huggingface.co/v1",
api_key=os.environ["HF_TOKEN"],
)
completion = client.chat.completions.create(
model="CohereLabs/aya-vision-32b:cohere",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
],
)
print(completion.choices[0].message)
