Edit model card

Llama-3-EZO-VLM-1

image/png

Based on SakanaAI/Llama-3-EvoVLM-JP-v2, it has been enhanced for Japanese usage through additional pre-training and instruction tuning.

This model is based on Llama-3-8B-Instruct and is subject to the Llama-3 Terms of Use. For detailed information, please refer to the official Llama-3 license page.

このモデルはSakanaAI/Llama-3-EvoVLM-JP-v2をベースにしており、Llama-3の利用規約に従います。詳細については、Llama-3の公式ライセンスページをご参照ください。

DEMO

https://huggingface.co/spaces/HODACHI/Llama-3-EZO-VLM-1

Model Details

This model is based on Llama-3-8B-Instruct, enhanced with multiple tuning techniques to improve its general performance. While it excels in Japanese language tasks, it's designed to meet diverse needs globally.

SakanaAI/Llama-3-EvoVLM-JP-v2をベースとして、複数のチューニング手法を採用のうえ、元のVision性能を落とさずに、汎用的にテキスト処理性能を向上させたモデルです。 日本語タスクに優れつつ、世界中の多様なニーズに応える設計となっています。

[Benchmark Results]

ElyzaTasks100

image/png ベースモデルから、0.7ポイントと大幅な性能向上

画像説明力

image/png 4つの例のすべてにおいて、ベースモデルから認識力・説明力の向上を実現しています。

以下は、GPT4, SakanaAI社のBaseModel、EZOのモデルのそれぞれの同一画像・同一プロンプトに対する出力を、GPT-4oに評価させた結果です。 image/png

[Usage]

pip install git+https://github.com/TIGER-AI-Lab/Mantis.git
import requests
from PIL import Image

import torch
from mantis.models.conversation import Conversation, SeparatorStyle
from mantis.models.mllava import chat_mllava, LlavaForConditionalGeneration, MLlavaProcessor
from mantis.models.mllava.utils import conv_templates
from transformers import AutoTokenizer

# 1. Set the system prompt
conv_llama_3_elyza = Conversation(
    system="<|start_header_id|>system<|end_header_id|>\n\nあなたは誠実で優秀な日本人のアシスタントです。特に指示が無い場合は、常に日本語で回答してください。",
    roles=("user", "assistant"),
    messages=(),
    offset=0,
    sep_style=SeparatorStyle.LLAMA_3,
    sep="<|eot_id|>",
)
conv_templates["llama_3"] = conv_llama_3_elyza

# 2. Load model
device = "cuda" if torch.cuda.is_available() else "cpu"
model_id = "HODACHI/Llama-3-EZO-VLM-1"

processor = MLlavaProcessor.from_pretrained("TIGER-Lab/Mantis-8B-siglip-llama3")
processor.tokenizer.pad_token = processor.tokenizer.eos_token

model = LlavaForConditionalGeneration.from_pretrained(model_id, torch_dtype=torch.float16, device_map=device).eval()

# 3. Prepare a generate config
generation_kwargs = {
    "max_new_tokens": 256,
    "num_beams": 1,
    "do_sample": False,
    "no_repeat_ngram_size": 3,
}

# 4. Generate
text = "<image>の信号は何色ですか?"
url_list = [
    "https://images.unsplash.com/photo-1694831404826-3400c48c188d?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
    "https://images.unsplash.com/photo-1693240876439-473af88b4ed7?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
]
images = [
   Image.open(requests.get(url_list[0], stream=True).raw).convert("RGB")
]

response, history = chat_mllava(text, images, model, processor, **generation_kwargs)

print(response)
# 信号の色は、青色です。

# 5. Multi-turn conversation
text = "では、<image>の信号は?"
images += [
   Image.open(requests.get(url_list[1], stream=True).raw).convert("RGB")
]
response, history = chat_mllava(text, images, model, processor, history=history, **generation_kwargs)

print(response)
# 赤色

Model Details

[Model Data]

Training Dataset]

We extracted high-quality data from Japanese Wikipedia and FineWeb to create instruction data. Our innovative training approach allows for performance improvements across various languages and domains, making the model suitable for global use despite its focus on Japanese data.

日本語のWikiデータおよび、FineWebから良質なデータのみを抽出し、Instructionデータを作成しました。 このモデルでは日本語に特化させていますが、世界中のどんなユースケースでも利用可能なアプローチです。

https://huggingface.co/datasets/legacy-datasets/wikipedia https://huggingface.co/datasets/HuggingFaceFW/fineweb

Data Preprocessing

We used a plain instruction tuning method to train the model on exemplary responses. This approach enhances the model's ability to understand and generate high-quality responses across various languages and contexts.

プレインストラクトチューニング手法を用いて、模範的回答を学習させました。この手法により、モデルは様々な言語やコンテキストにおいて高品質な応答を理解し生成する能力が向上しています。

Implementation Information

[Pre-Instruction Training]

https://huggingface.co/instruction-pretrain/instruction-synthesizer

[Disclaimer]

このモデルは研究開発のみを目的として提供されるものであり、実験的なプロトタイプとみなされるべきモデルです。 商業的な使用やミッションクリティカルな環境への配備を意図したものではありません。 本モデルの使用は、使用者の責任において行われるものとし、その性能および結果は保証されません。 Axcxept株式会社は、直接的、間接的、特別、偶発的、結果的な損害、または本モデルの使用から生じるいかなる損失に対しても、得られた結果にかかわらず、一切の責任を負いません。 利用者は、本モデルの使用に伴うリスクを十分に理解し、自己の判断で使用するものとします。

[注意事項]

SakanaAI社のモデルを活用させていただいておりますが、弊社及び、本モデル・本スペースに関し、SakanaAI社との直接的な関係性は一切ございません。 リスペクトを示すとともに、SakanaAI社へのお問い合わせはご遠慮ください。

[Hardware]

A100 × 8(Running in 4h)

[謝辞]

本ベースモデルを開発してくださったMeta社、カスタマイズを行ったSakanaAI社ならびに、各社の当該チームの開発者の方々、また自動評価の手法を提供してくださった多数の方々に感謝と尊敬の意を表します。

[We are.]

Axcxept logo

Downloads last month
71
Safetensors
Model size
8.48B params
Tensor type
FP16
·
Inference Examples
Inference API (serverless) is not available, repository is disabled.

Space using AXCXEPT/Llama-3-EZO-VLM-1 1

Collection including AXCXEPT/Llama-3-EZO-VLM-1