Update README.md
Browse files
README.md
CHANGED
@@ -1,199 +1,172 @@
|
|
1 |
---
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
---
|
5 |
|
6 |
-
#
|
7 |
|
8 |
-
|
9 |
|
|
|
|
|
10 |
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
### Model Description
|
15 |
-
|
16 |
-
<!-- Provide a longer summary of what this model is. -->
|
17 |
-
|
18 |
-
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
|
19 |
-
|
20 |
-
- **Developed by:** [More Information Needed]
|
21 |
-
- **Funded by [optional]:** [More Information Needed]
|
22 |
-
- **Shared by [optional]:** [More Information Needed]
|
23 |
-
- **Model type:** [More Information Needed]
|
24 |
-
- **Language(s) (NLP):** [More Information Needed]
|
25 |
-
- **License:** [More Information Needed]
|
26 |
-
- **Finetuned from model [optional]:** [More Information Needed]
|
27 |
-
|
28 |
-
### Model Sources [optional]
|
29 |
-
|
30 |
-
<!-- Provide the basic links for the model. -->
|
31 |
-
|
32 |
-
- **Repository:** [More Information Needed]
|
33 |
-
- **Paper [optional]:** [More Information Needed]
|
34 |
-
- **Demo [optional]:** [More Information Needed]
|
35 |
-
|
36 |
-
## Uses
|
37 |
-
|
38 |
-
<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
|
39 |
-
|
40 |
-
### Direct Use
|
41 |
-
|
42 |
-
<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
|
43 |
-
|
44 |
-
[More Information Needed]
|
45 |
-
|
46 |
-
### Downstream Use [optional]
|
47 |
-
|
48 |
-
<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->
|
49 |
-
|
50 |
-
[More Information Needed]
|
51 |
-
|
52 |
-
### Out-of-Scope Use
|
53 |
-
|
54 |
-
<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
|
55 |
-
|
56 |
-
[More Information Needed]
|
57 |
-
|
58 |
-
## Bias, Risks, and Limitations
|
59 |
-
|
60 |
-
<!-- This section is meant to convey both technical and sociotechnical limitations. -->
|
61 |
-
|
62 |
-
[More Information Needed]
|
63 |
-
|
64 |
-
### Recommendations
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
|
69 |
-
|
70 |
-
## How to Get Started with the Model
|
71 |
-
|
72 |
-
Use the code below to get started with the model.
|
73 |
-
|
74 |
-
[More Information Needed]
|
75 |
-
|
76 |
-
## Training Details
|
77 |
-
|
78 |
-
### Training Data
|
79 |
-
|
80 |
-
<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
|
81 |
-
|
82 |
-
[More Information Needed]
|
83 |
-
|
84 |
-
### Training Procedure
|
85 |
-
|
86 |
-
<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
|
87 |
-
|
88 |
-
#### Preprocessing [optional]
|
89 |
-
|
90 |
-
[More Information Needed]
|
91 |
-
|
92 |
-
|
93 |
-
#### Training Hyperparameters
|
94 |
-
|
95 |
-
- **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
|
96 |
-
|
97 |
-
#### Speeds, Sizes, Times [optional]
|
98 |
-
|
99 |
-
<!-- This section provides information about throughput, start/end time, checkpoint size if relevant, etc. -->
|
100 |
-
|
101 |
-
[More Information Needed]
|
102 |
-
|
103 |
-
## Evaluation
|
104 |
-
|
105 |
-
<!-- This section describes the evaluation protocols and provides the results. -->
|
106 |
|
107 |
-
|
|
|
108 |
|
109 |
-
#### Testing Data
|
110 |
|
111 |
-
|
112 |
|
113 |
-
|
114 |
|
115 |
-
|
|
|
116 |
|
117 |
-
|
118 |
|
119 |
-
[
|
|
|
120 |
|
121 |
-
#### Metrics
|
122 |
|
123 |
-
|
124 |
|
125 |
-
|
126 |
|
127 |
-
|
|
|
128 |
|
129 |
-
|
130 |
|
131 |
-
|
132 |
|
|
|
133 |
|
|
|
|
|
134 |
|
135 |
-
|
136 |
|
137 |
-
|
138 |
|
139 |
-
[More Information Needed]
|
140 |
|
141 |
-
|
|
|
|
|
|
|
142 |
|
143 |
-
|
|
|
|
|
144 |
|
145 |
-
|
|
|
|
|
|
|
|
|
146 |
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
-
|
|
|
|
|
154 |
|
155 |
-
|
|
|
156 |
|
157 |
-
|
158 |
|
159 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
160 |
|
161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
162 |
|
163 |
-
|
164 |
|
165 |
-
|
|
|
166 |
|
167 |
-
|
|
|
|
|
|
|
|
|
|
|
168 |
|
169 |
-
|
|
|
|
|
170 |
|
171 |
-
## Citation [optional]
|
172 |
|
173 |
-
|
174 |
|
175 |
-
|
176 |
|
177 |
-
[
|
|
|
|
|
|
|
178 |
|
179 |
-
**APA:**
|
180 |
|
181 |
-
[
|
|
|
|
|
182 |
|
183 |
-
|
|
|
184 |
|
185 |
-
|
|
|
186 |
|
187 |
-
|
|
|
188 |
|
189 |
-
|
190 |
|
191 |
-
|
|
|
192 |
|
193 |
-
|
194 |
|
195 |
-
[
|
|
|
196 |
|
197 |
-
|
|
|
198 |
|
199 |
-
[More Information Needed]
|
|
|
1 |
---
|
2 |
+
language:
|
3 |
+
- ja
|
4 |
+
license: llama3
|
5 |
+
tags:
|
6 |
+
- multimodal
|
7 |
+
- vision-language
|
8 |
+
- mantis
|
9 |
+
- llava
|
10 |
+
- llama3
|
11 |
+
- siglip
|
12 |
+
pipeline_tag: image-to-text
|
13 |
---
|
14 |
|
15 |
+
# Llama-3-EZO-VLM-1
|
16 |
|
17 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/657e900beaad53ff67ba84db/gF93nHQfSej3QFPFe6gfS.png)
|
18 |
|
19 |
+
Based on [SakanaAI/Llama-3-EvoVLM-JP-v2](https://huggingface.co/SakanaAI/Llama-3-EvoVLM-JP-v2),
|
20 |
+
it has been enhanced for Japanese usage through additional pre-training and instruction tuning.
|
21 |
|
22 |
+
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.
|
23 |
|
24 |
+
このモデルはSakanaAI/Llama-3-EvoVLM-JP-v2をベースにしており、Llama-3の利用規約に従います。詳細については、Llama-3の公式ライセンスページをご参照ください。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
## Model Details
|
27 |
+
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
+
SakanaAI/Llama-3-EvoVLM-JP-v2をベースとして、複数のチューニング手法を採用のうえ、元のVision性能を落とさずに、汎用的にテキスト処理性能を向上させたモデルです。
|
30 |
+
日本語タスクに優れつつ、世界中の多様なニーズに応える設計となっています。
|
31 |
|
|
|
32 |
|
33 |
+
### [Benchmark Results]
|
34 |
|
35 |
+
#### ElyzaTasks100
|
36 |
|
37 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/657e900beaad53ff67ba84db/SiIjRV_ecfFvHCiq9x7BQ.png)
|
38 |
+
ベースモデルから、0.7ポイントと大幅な性能向上
|
39 |
|
40 |
+
#### 画像説明力
|
41 |
|
42 |
+
![image/png](https://cdn-uploads.huggingface.co/production/uploads/657e900beaad53ff67ba84db/sY4xjsZfdySmZUF1sQZNj.png)
|
43 |
+
4つの例のすべてにおいて、ベースモデルから認識力・説明力の向上を実現。
|
44 |
|
|
|
45 |
|
46 |
+
### 推奨される使用ガイドライン / Recommended Usage Guidelines
|
47 |
|
48 |
+
1. **商用利用**: 本モデルを商用目的で使用する場合、[email protected] へのメール連絡を強く推奨します。これにより、モデルの応用や改善についての協力の機会が生まれる可能性があります。
|
49 |
|
50 |
+
2. **クレジット表記**: 本モデルを使用または改変する際は、以下のようなクレジット表記を行うことを推奨します:
|
51 |
+
"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."
|
52 |
|
53 |
+
3. **フィードバック**: モデルの使用経験に関するフィードバックを歓迎します。[email protected] までご連絡ください。
|
54 |
|
55 |
+
これらは推奨事項であり、法的要件ではありません。本モデルの使用は主に SakanaAI/Llama-3-EvoVLM-JP-v2=Llama-3をベースにしており、Llama-3の利用規約に準拠します。
|
56 |
|
57 |
+
1. **Commercial Use**: If you plan to use this model for commercial purposes, we strongly encourage you to inform us via email at [email protected]. This allows for potential collaboration on model applications and improvements.
|
58 |
|
59 |
+
2. **Attribution**: When using or adapting this model, we recommend providing attribution as follows:
|
60 |
+
"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."
|
61 |
|
62 |
+
3. **Feedback**: We welcome any feedback on your experience with the model. Please feel free to email us at [email protected].
|
63 |
|
64 |
+
Please note that these are recommendations and not legal requirements. Your use of this model is primarily governed by the Llama-3 License Agreement.
|
65 |
|
|
|
66 |
|
67 |
+
### [Usage]
|
68 |
+
```bash
|
69 |
+
pip install git+https://github.com/TIGER-AI-Lab/Mantis.git
|
70 |
+
```
|
71 |
|
72 |
+
```python
|
73 |
+
import requests
|
74 |
+
from PIL import Image
|
75 |
|
76 |
+
import torch
|
77 |
+
from mantis.models.conversation import Conversation, SeparatorStyle
|
78 |
+
from mantis.models.mllava import chat_mllava, LlavaForConditionalGeneration, MLlavaProcessor
|
79 |
+
from mantis.models.mllava.utils import conv_templates
|
80 |
+
from transformers import AutoTokenizer
|
81 |
|
82 |
+
# 1. Set the system prompt
|
83 |
+
conv_llama_3_elyza = Conversation(
|
84 |
+
system="<|start_header_id|>system<|end_header_id|>\n\nあなたは誠実で優秀な日本人のアシスタントです。特に指示が無い場合は、常に日本語で回答してください。",
|
85 |
+
roles=("user", "assistant"),
|
86 |
+
messages=(),
|
87 |
+
offset=0,
|
88 |
+
sep_style=SeparatorStyle.LLAMA_3,
|
89 |
+
sep="<|eot_id|>",
|
90 |
+
)
|
91 |
+
conv_templates["llama_3"] = conv_llama_3_elyza
|
92 |
|
93 |
+
# 2. Load model
|
94 |
+
device = "cuda" if torch.cuda.is_available() else "cpu"
|
95 |
+
model_id = "HODACHI/Llama-3-EZO-VLM-1"
|
96 |
|
97 |
+
processor = MLlavaProcessor.from_pretrained("TIGER-Lab/Mantis-8B-siglip-llama3")
|
98 |
+
processor.tokenizer.pad_token = processor.tokenizer.eos_token
|
99 |
|
100 |
+
model = LlavaForConditionalGeneration.from_pretrained(model_id, torch_dtype=torch.float16, device_map=device).eval()
|
101 |
|
102 |
+
# 3. Prepare a generate config
|
103 |
+
generation_kwargs = {
|
104 |
+
"max_new_tokens": 256,
|
105 |
+
"num_beams": 1,
|
106 |
+
"do_sample": False,
|
107 |
+
"no_repeat_ngram_size": 3,
|
108 |
+
}
|
109 |
|
110 |
+
# 4. Generate
|
111 |
+
text = "<image>の信号は何色ですか?"
|
112 |
+
url_list = [
|
113 |
+
"https://images.unsplash.com/photo-1694831404826-3400c48c188d?q=80&w=2070&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
|
114 |
+
"https://images.unsplash.com/photo-1693240876439-473af88b4ed7?q=80&w=1974&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D"
|
115 |
+
]
|
116 |
+
images = [
|
117 |
+
Image.open(requests.get(url_list[0], stream=True).raw).convert("RGB")
|
118 |
+
]
|
119 |
|
120 |
+
response, history = chat_mllava(text, images, model, processor, **generation_kwargs)
|
121 |
|
122 |
+
print(response)
|
123 |
+
# 信号の色は、青色です。
|
124 |
|
125 |
+
# 5. Multi-turn conversation
|
126 |
+
text = "では、<image>の信号は?"
|
127 |
+
images += [
|
128 |
+
Image.open(requests.get(url_list[1], stream=True).raw).convert("RGB")
|
129 |
+
]
|
130 |
+
response, history = chat_mllava(text, images, model, processor, history=history, **generation_kwargs)
|
131 |
|
132 |
+
print(response)
|
133 |
+
# 赤色
|
134 |
+
```
|
135 |
|
|
|
136 |
|
137 |
+
## Model Details
|
138 |
|
139 |
+
<!-- Provide a longer summary of what this model is. -->
|
140 |
|
141 |
+
- **Developed by:** [Axcxept co., ltd.](https://axcxept.com)
|
142 |
+
- **Model type:** Autoregressive Language Model
|
143 |
+
- **Language(s):** Japanese
|
144 |
+
- **License:** [META LLAMA 3 COMMUNITY LICENSE](https://llama.meta.com/llama3/license/)
|
145 |
|
|
|
146 |
|
147 |
+
### [Model Data]
|
148 |
+
#### Training Dataset]
|
149 |
+
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.
|
150 |
|
151 |
+
日本語のWikiデータおよび、FineWebから良質なデータのみを抽出し、Instructionデータを作成しました。
|
152 |
+
このモデルでは日本語に特化させていますが、世界中のどんなユースケースでも利用可能なアプローチです。
|
153 |
|
154 |
+
https://huggingface.co/datasets/legacy-datasets/wikipedia
|
155 |
+
https://huggingface.co/datasets/HuggingFaceFW/fineweb
|
156 |
|
157 |
+
#### Data Preprocessing
|
158 |
+
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.
|
159 |
|
160 |
+
プレインストラクトチューニング手法を用いて、模範的回答を学習させました。この手法により、モデルは様々な言語やコンテキストにおいて高品質な応答を理解し生成する能力が向上しています。
|
161 |
|
162 |
+
#### Implementation Information
|
163 |
+
[Pre-Instruction Training]
|
164 |
|
165 |
+
https://huggingface.co/instruction-pretrain/instruction-synthesizer
|
166 |
|
167 |
+
### [Hardware]
|
168 |
+
A100 × 8(Running in 4h)
|
169 |
|
170 |
+
### [We are.]
|
171 |
+
[![Axcxept logo](https://cdn-uploads.huggingface.co/production/uploads/657e900beaad53ff67ba84db/8OKW86U986ywttvL2RcbG.png)](https://axcxept.com)
|
172 |
|
|