🚀 Centurio Aya
Centurio Aya是一個開源的多語言大型視覺語言模型,支持100種語言,可通過transformers
庫直接使用,在圖像文本處理方面有廣泛應用。
🚀 快速開始
該模型可以通過transformers
庫結合自定義代碼直接使用。以下是一個基本的使用示例:
from transformers import AutoModelForCausalLM, AutoProcessor
import timm
from PIL import Image
import requests
url = "https://upload.wikimedia.org/wikipedia/commons/b/bd/Golden_Retriever_Dukedestiny01_drvd.jpg"
image = Image.open(requests.get(url, stream=True).raw)
model_name = "WueNLP/centurio_aya"
processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
prompt = "<image_placeholder>\nBriefly describe the image in German."
messages = [
{"role": "user", "content": prompt}
]
text = processor.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model = AutoModelForCausalLM.from_pretrained(
model_name,
trust_remote_code=True
)
model_inputs = processor(text=[text], images=[image], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=128
)
generated_ids = [
output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]
response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
多圖像輸入
該模型原生支持多圖像輸入。你只需在提示中包含更多的<image_placeholder>
,並將整個批次的所有圖像作為一個扁平列表傳遞:
[...]
image_multi_1, image_multi_2 = [...]
prompt_multi = "What is the difference between the following images?\n<image_placeholder><image_placeholder>\nAnswer in German."
messages_multi = [
{"role": "user", "content": prompt_multi}
]
text_multi = processor.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True
)
model_inputs = processor(text=[text, text_multi], images=[image, image_multi_1, image_multi_2], return_tensors="pt").to(model.device)
generated_ids = model.generate(
**model_inputs,
max_new_tokens=128
)
[...]
✨ 主要特性
- 多語言支持:模型支持100種語言,包括
af, am, ar
等。
- 圖像文本處理:支持圖像文本到文本的轉換,可用於描述圖像等任務。
- 多圖像輸入:原生支持多圖像輸入,方便處理複雜場景。
📚 詳細文檔
模型詳情
模型描述
- 模型類型:Centurio是一個開源的多語言大型視覺語言模型。
- 訓練數據:即將公佈。
- 支持語言:該模型使用以下100種語言進行訓練:
af, am, ar, ar-eg, as, azb, be, bg, bm, bn, bo, bs, ca, ceb, cs, cy, da, de, du, el, en, eo, es, et, eu, fa, fi, fr, ga, gd, gl, ha, hi, hr, ht, hu, id, ig, is, it, iw, ja, jv, ka, ki, kk, km, ko, la, lb, ln, lo, lt, lv, mi, mr, ms, mt, my, no, oc, pa, pl, pt, qu, ro, ru, sa, sc, sd, sg, sk, sl, sm, so, sq, sr, ss, sv, sw, ta, te, th, ti, tl, tn, tpi, tr, ts, tw, uk, ur, uz, vi, war, wo, xh, yo, zh, zu
。
- 許可證:本作品採用知識共享署名-非商業性使用4.0國際許可協議發佈。
屬性 |
詳情 |
模型類型 |
Centurio是一個開源的多語言大型視覺語言模型。 |
訓練數據 |
即將公佈 |
模型來源
偏差、風險和侷限性
- 通用問題:大型視覺語言模型常見的偏差、風險和侷限性,如幻覺或訓練數據帶來的偏差。
- 生產使用:這是一個研究項目,不建議用於生產環境。
- 多語言性能:不同語言之間的性能和生成質量可能存在較大差異。
- OCR問題:模型在處理小文本和非拉丁文字腳本時存在困難。
⚠️ 重要提示
該模型存在一些侷限性,如大型視覺語言模型常見的幻覺問題、不同語言性能差異大以及處理小文本和非拉丁文字腳本困難等,且不建議用於生產環境。
引用
BibTeX:
@article{centurio2025,
author = {Gregor Geigle and
Florian Schneider and
Carolin Holtermann and
Chris Biemann and
Radu Timofte and
Anne Lauscher and
Goran Glava\v{s}},
title = {Centurio: On Drivers of Multilingual Ability of Large Vision-Language Model},
journal = {arXiv},
volume = {abs/2501.05122},
year = {2025},
url = {https://arxiv.org/abs/2501.05122},
eprinttype = {arXiv},
eprint = {2501.05122},
}
📄 許可證
本作品採用知識共享署名-非商業性使用4.0國際許可協議發佈。