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

推奨される使用ガイドライン / Recommended Usage Guidelines

  1. 商用利用: 本モデルを商用目的で使用する場合、info@axcxept.com へのメール連絡を強く推奨します。これにより、モデルの応用や改善についての協力の機会が生まれる可能性があります。

  2. クレジット表記: 本モデルを使用または改変する際は、以下のようなクレジット表記を行うことを推奨します: "This project utilizes HODACHI/Llama-3-EZO-VLM-1, a model based on SakanaAI/Llama-3-EvoVLM-JP-v2/Llama-3 and fine-tuned by Axcxept co., ltd."

  3. フィードバック: モデルの使用経験に関するフィードバックを歓迎します。info@axcxept.com までご連絡ください。

これらは推奨事項であり、法的要件ではありません。本モデルの使用は主に SakanaAI/Llama-3-EvoVLM-JP-v2=Llama-3をベースにしており、Llama-3の利用規約に準拠します。

  1. Commercial Use: If you plan to use this model for commercial purposes, we strongly encourage you to inform us via email at info@axcxept.com. This allows for potential collaboration on model applications and improvements.

  2. Attribution: When using or adapting this model, we recommend providing attribution as follows: "This project utilizes HODACHI/Llama-3-EZO-VLM-1, a model based on SakanaAI/Llama-3-EvoVLM-JP-v2/Llama-3 and fine-tuned by Axcxept co., ltd."

  3. Feedback: We welcome any feedback on your experience with the model. Please feel free to email us at info@axcxept.com.

Please note that these are recommendations and not legal requirements. Your use of this model is primarily governed by the Llama-3 License Agreement.

[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)

[We are.]

Axcxept logo

Downloads last month
265
Safetensors
Model size
8.48B params
Tensor type
FP16
·
Inference API
Unable to determine this model's library. Check the docs .

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

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