中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁 > news >正文

如何提升網(wǎng)站訪問速度文章推廣平臺

如何提升網(wǎng)站訪問速度,文章推廣平臺,照明設(shè)計(jì)師,江陰網(wǎng)站開發(fā)文章目錄 一、模型介紹二、預(yù)期用途1. 視覺問答(VQA)與視覺推理2. 文檔視覺問答(DocVQA)3. 圖像字幕4. 圖像-文本檢索5. 視覺接地 三、本地部署1. 下載模型2. 模型大小3. 運(yùn)行代碼 四、ollama部署1. 安裝ollama2. 安裝 Llama 3.2 Vision 模型3. 運(yùn)行 Llama 3.2-Vision 五、效果…

文章目錄

  • 一、模型介紹
  • 二、預(yù)期用途
    • 1. 視覺問答(VQA)與視覺推理
    • 2. 文檔視覺問答(DocVQA)
    • 3. 圖像字幕
    • 4. 圖像-文本檢索
    • 5. 視覺接地
  • 三、本地部署
    • 1. 下載模型
    • 2. 模型大小
    • 3. 運(yùn)行代碼
  • 四、ollama部署
    • 1. 安裝ollama
    • 2. 安裝 Llama 3.2 Vision 模型
    • 3. 運(yùn)行 Llama 3.2-Vision
  • 五、效果展示

一、模型介紹

Llama 3.2-Vision 是一系列多模態(tài)大語言模型(LLM),包括預(yù)訓(xùn)練和指令調(diào)優(yōu)的圖像推理生成模型大小分別為11B和90B(輸入為文本+圖像/輸出為文本)。Lama 3.2-Vision 指令調(diào)優(yōu)模型針對視覺識別、圖像推理、字幕生成以及回答關(guān)于圖像的一般問題進(jìn)行了優(yōu)化。這些模型在常見的行業(yè)基準(zhǔn)測試中表現(xiàn)優(yōu)于許多可用的開源和閉源多模態(tài)模型,
模型開發(fā)者: Meta
模型架構(gòu): Llama 3.2-Vision 基于 Lama 3.1 文本模型構(gòu)建,后者是一個使用優(yōu)化的Transformer架構(gòu)的自回歸語言模型。調(diào)優(yōu)版本使用有監(jiān)督的微調(diào)(SFT)和基于人類反饋的強(qiáng)化學(xué)習(xí)(RLHF)來與人類對有用性和安全性的偏好保持一致。為了支持圖像識別任務(wù),Llama 3.2-Vision 模型使用了單獨(dú)訓(xùn)練的視覺適配器,該適配器與預(yù)訓(xùn)練的 Llama 3.1 語言模型集成。適配器由一系列交叉注意力層組成,將圖像編碼器表示傳遞給核心LLM。
支持的語言:對于純文本任務(wù),官方支持英語、德語、法語、意大利語、葡萄牙語、印地語、西班牙語和泰語。Llama3.2的訓(xùn)練數(shù)據(jù)集包含了比這八種語言更廣泛的語言。注意,對于圖像+文本應(yīng)用,僅支持英語。
開發(fā)者可以在遵守 Llama 3.2 社區(qū)許可證和可接受使用政策的前提下,對 Lama 3.2 模型進(jìn)行其他語言的微調(diào)。開發(fā)者始終應(yīng)確保其部署,包括涉及額外語言的部署,是安全且負(fù)責(zé)任的。
模型發(fā)布日期:2024年9月25日
在這里插入圖片描述

二、預(yù)期用途

預(yù)期用途案例: Llama 3.2-Vision旨在用于商業(yè)和研究用途。經(jīng)過指令調(diào)優(yōu)的模型適用于視覺識別、圖像推理、字幕添加以及帶有圖像的助手式聊天,而預(yù)訓(xùn)練模型可以適應(yīng)多種圖像推理任務(wù)。此外,由于Llama 3.2-Vision能夠接受圖像和文本作為輸入,因此還可能包括以下用途:

1. 視覺問答(VQA)與視覺推理

想象一臺機(jī)器能夠査看圖片并理解您對其提出的問題。

2. 文檔視覺問答(DocVQA)

想象計(jì)算機(jī)能夠理解文檔(如地圖或合同)中的文本和布局,并直接從圖像中回答問題。

3. 圖像字幕

圖像字幕架起了視覺與語言之間的橋梁,提取細(xì)節(jié),理解場景,然后構(gòu)造一兩句講述故事的話。

4. 圖像-文本檢索

圖像-文本檢索就像是為圖像及其描述做媒人。類似于搜索引擎,但這種引擎既理解圖片也理解文字。

5. 視覺接地

視覺接地就像將我們所見與所說連接起來。它關(guān)乎于理解語言如何引用圖像中的特定部分,允許AI模型基于自然語言描述來精確定位對象或區(qū)域。

三、本地部署

1. 下載模型

#模型下載 
from modelscope import snapshot_download model_dir = snapshot_download('AI-ModelScope/Llama-3.2-11B-Vision-Instruct-GGUF')

2. 模型大小

在這里插入圖片描述

3. 運(yùn)行代碼

在運(yùn)行代碼前先確保安裝了transformers包
pip install --upgrade transformers

import requests
import torch
from PIL import Image
from transformers import MllamaForConditionalGeneration, AutoProcessor
from modelscope import snapshot_download
model_id = "LLM-Research/Llama-3.2-11B-Vision-Instruct"
model_dir = snapshot_download(model_id, ignore_file_pattern=['*.pth'])model = MllamaForConditionalGeneration.from_pretrained(model_dir,torch_dtype=torch.bfloat16,device_map="auto",
)
processor = AutoProcessor.from_pretrained(model_dir)url = "https://www.modelscope.cn/models/LLM-Research/Llama-3.2-11B-Vision/resolve/master/rabbit.jpg"
image = Image.open(requests.get(url, stream=True).raw)messages = [{"role": "user", "content": [{"type": "image"},{"type": "text", "text": "If I had to write a haiku for this one, it would be: "}]}
]
input_text = processor.apply_chat_template(messages, add_generation_prompt=True)
inputs = processor(image, input_text, return_tensors="pt").to(model.device)output = model.generate(**inputs, max_new_tokens=30)
print(processor.decode(output[0]))

四、ollama部署

ollama部署模型最為方便,不需要寫運(yùn)行代碼,也不需要安裝各種庫,ollama安裝好后,run相應(yīng)模型,它會自動下載,然后直接可以進(jìn)行提問,不需要運(yùn)行什么代碼。

1. 安裝ollama

#o11ama版本需大于等于0.4.0
curl -fsSL https://ollama.com/install.sh | sh
#查看o1lama版本
ollama --version

2. 安裝 Llama 3.2 Vision 模型

o1lama run 1lama3.2-vision:1lb

3. 運(yùn)行 Llama 3.2-Vision

將 images.png替換為自己的圖像路徑。模型將分析圖像并根據(jù)其理解提供響應(yīng)。

ollama run x/llama3.2-vision:latest "which era does this piece belong to? Give details about the era: images.png

五、效果展示

在這里插入圖片描述
給大模型一張圖片,然后附帶問題是:這件作品屬于哪個時代?詳細(xì)介紹那個時代。下面是模型輸出

The piece is a painting of a woman in a red dress, surrounded by gold and white ornate details.The woman is depicted in mid-air, with her arms outstretched and her legs bent at the knees. Sheis holding a bouquet of flowers in her right hand and a fruit in her left hand.
The background of the painting is a light blue sky with pink clouds, and there are also some pinkflowers and green leaves surrounding the woman. The overall atmosphere of the painting is oneof joy and celebration, as if the woman is dancing or celebrating something.
This piece belongs to the Rococo era, which was a style of art and architecture that emerged inEurope in the 18th century. The Rococo style is characterized by its use of pastel colors, curvedlines, and ornate details. lt was popularized during the reign of King Louis XV of France, who ruledfrom 1715 to 1774.

為更直觀翻譯下,可以看到基本把圖片細(xì)節(jié)都描述很清楚,同事也給出了大致時代。
在這里插入圖片描述

http://www.risenshineclean.com/news/45002.html

相關(guān)文章:

  • 網(wǎng)站開發(fā)需要幾個人網(wǎng)站開發(fā)流程是什么
  • 用dw做網(wǎng)站 的過程seo薪酬
  • 購物網(wǎng)站設(shè)計(jì)開題報(bào)告微商軟文范例大全100
  • 網(wǎng)站制seopc流量排名官網(wǎng)
  • wordpress 所有文章優(yōu)化seo
  • 前端做網(wǎng)站是什么流程代運(yùn)營公司
  • 重慶網(wǎng)站優(yōu)化公司惠州seo計(jì)費(fèi)管理
  • 做創(chuàng)意ppt網(wǎng)站有哪些方面網(wǎng)絡(luò)seo首頁
  • saas 做網(wǎng)站合肥網(wǎng)絡(luò)營銷公司
  • 國外黃岡網(wǎng)站推廣西安發(fā)布最新通知
  • 韓國免費(fèi)行情網(wǎng)站的推薦理由seo優(yōu)化方式包括
  • 自己組裝電腦做網(wǎng)站服務(wù)器不受國內(nèi)限制的瀏覽器
  • 做網(wǎng)站自適應(yīng)框架他達(dá)那非片能延時多久
  • 貴德網(wǎng)站建設(shè)公司專業(yè)網(wǎng)站優(yōu)化
  • 內(nèi)衣網(wǎng)站建設(shè)詳細(xì)方案seo官網(wǎng)優(yōu)化詳細(xì)方法
  • 大連網(wǎng)站建設(shè)酷網(wǎng)seo網(wǎng)站快速排名外包
  • 鎮(zhèn)江網(wǎng)站建設(shè)yubei021快速建站哪個平臺好
  • 國外做兼職的網(wǎng)站企業(yè)品牌網(wǎng)站營銷
  • wordpress評論樓廣州百度seo排名
  • 如何給網(wǎng)站做宣傳aso優(yōu)化費(fèi)用
  • 永州做網(wǎng)站費(fèi)用做百度線上推廣
  • 莆田交友網(wǎng)站市場惠州網(wǎng)站建設(shè)方案推廣
  • 東莞專業(yè)網(wǎng)站建設(shè)推廣seo屬于什么
  • 如何簡述網(wǎng)站建設(shè)流程seo是什么?
  • 網(wǎng)站整體運(yùn)營思路競價(jià)推廣托管服務(wù)
  • 車輛對比那個網(wǎng)站做的好免費(fèi)網(wǎng)絡(luò)推廣的方法
  • 昆明利于優(yōu)化的網(wǎng)站河南自助建站seo公司
  • 佛山營銷網(wǎng)站建設(shè)seo快速工具
  • 長春網(wǎng)站建設(shè)58同城想在百度做推廣怎么做
  • 國外做家譜的網(wǎng)站開發(fā)小程序