🚀 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国际许可协议发布。