Llama 3.2 Vision 是一系列經過指令微調的圖像推理生成模型,具有 11B 和 90B 兩種尺寸。

視覺 11b 90b

1M 2 個月前

讀我

Llama 3.2-Vision 多模態大型語言模型 (LLM) 系列是一系列經過指令微調的圖像推理生成模型,具有 11B 和 90B 兩種尺寸(輸入文字 + 圖像 / 輸出文字)。Llama 3.2-Vision 指令微調模型針對視覺辨識、圖像推理、圖像標註和回答關於圖像的通用問題進行了最佳化。這些模型在常見的行業基準測試中,效能優於許多現有的開放原始碼和封閉式多模態模型。

支援語言:對於僅限文字的任務,官方支援英語、德語、法語、義大利語、葡萄牙語、印地語、西班牙語和泰語。Llama 3.2 的訓練語料庫比這 8 種支援語言更廣泛。請注意,對於圖像 + 文字應用,僅支援英語。

使用方式

首先,拉取模型

ollama pull llama3.2-vision

Python 函式庫

若要將 Llama 3.2 Vision 與 Ollama Python 函式庫搭配使用

import ollama

response = ollama.chat(
    model='llama3.2-vision',
    messages=[{
        'role': 'user',
        'content': 'What is in this image?',
        'images': ['image.jpg']
    }]
)

print(response)

JavaScript 函式庫

若要將 Llama 3.2 Vision 與 Ollama JavaScript 函式庫搭配使用

import ollama from 'ollama'

const response = await ollama.chat({
  model: 'llama3.2-vision',
  messages: [{
    role: 'user',
    content: 'What is in this image?',
    images: ['image.jpg']
  }]
})

console.log(response)

cURL

curl https://127.0.0.1:11434/api/chat -d '{
  "model": "llama3.2-vision",
  "messages": [
    {
      "role": "user",
      "content": "what is in this image?",
      "images": ["<base64-encoded image data>"]
    }
  ]
}'

參考文獻

GitHub

HuggingFace