Gregor commited on
Commit
3106666
·
verified ·
1 Parent(s): 5db0039

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +189 -140
README.md CHANGED
@@ -1,13 +1,114 @@
1
  ---
2
  library_name: transformers
3
- tags: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  ---
5
 
6
- # Model Card for Model ID
7
-
8
- <!-- Provide a quick summary of what the model is/does. -->
9
-
10
-
11
 
12
  ## Model Details
13
 
@@ -15,23 +116,19 @@ tags: []
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
 
@@ -41,159 +138,111 @@ This is the model card of a 🤗 transformers model that has been pushed on the
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
- <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
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
- ### Testing Data, Factors & Metrics
108
 
109
- #### Testing Data
110
 
111
- <!-- This should link to a Dataset Card if possible. -->
 
112
 
113
- [More Information Needed]
 
 
114
 
115
- #### Factors
116
 
117
- <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
118
 
119
- [More Information Needed]
 
 
 
120
 
121
- #### Metrics
 
 
 
 
122
 
123
- <!-- These are the evaluation metrics being used, ideally with a description of why. -->
124
 
125
- [More Information Needed]
 
 
 
126
 
127
- ### Results
128
 
129
- [More Information Needed]
130
 
131
- #### Summary
132
 
133
 
134
 
135
- ## Model Examination [optional]
136
-
137
- <!-- Relevant interpretability work for the model goes here -->
138
-
139
- [More Information Needed]
140
-
141
- ## Environmental Impact
142
-
143
- <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
144
-
145
- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
146
-
147
- - **Hardware Type:** [More Information Needed]
148
- - **Hours used:** [More Information Needed]
149
- - **Cloud Provider:** [More Information Needed]
150
- - **Compute Region:** [More Information Needed]
151
- - **Carbon Emitted:** [More Information Needed]
152
-
153
- ## Technical Specifications [optional]
154
-
155
- ### Model Architecture and Objective
156
-
157
- [More Information Needed]
158
-
159
- ### Compute Infrastructure
160
-
161
- [More Information Needed]
162
-
163
- #### Hardware
164
-
165
- [More Information Needed]
166
 
167
- #### Software
 
 
 
168
 
169
- [More Information Needed]
170
 
171
- ## Citation [optional]
172
 
173
  <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
174
 
175
  **BibTeX:**
176
 
177
- [More Information Needed]
178
-
179
- **APA:**
180
-
181
- [More Information Needed]
182
-
183
- ## Glossary [optional]
184
-
185
- <!-- If relevant, include terms and calculations in this section that can help readers understand the model or model card. -->
186
-
187
- [More Information Needed]
188
-
189
- ## More Information [optional]
190
-
191
- [More Information Needed]
192
-
193
- ## Model Card Authors [optional]
194
-
195
- [More Information Needed]
196
-
197
- ## Model Card Contact
198
-
199
- [More Information Needed]
 
1
  ---
2
  library_name: transformers
3
+ license: apache-2.0
4
+ language:
5
+ - multilingual
6
+ - af
7
+ - am
8
+ - ar
9
+ - as
10
+ - azb
11
+ - be
12
+ - bg
13
+ - bm
14
+ - bn
15
+ - bo
16
+ - bs
17
+ - ca
18
+ - ceb
19
+ - cs
20
+ - cy
21
+ - da
22
+ - de
23
+ - du
24
+ - el
25
+ - en
26
+ - eo
27
+ - es
28
+ - et
29
+ - eu
30
+ - fa
31
+ - fi
32
+ - fr
33
+ - ga
34
+ - gd
35
+ - gl
36
+ - ha
37
+ - hi
38
+ - hr
39
+ - ht
40
+ - hu
41
+ - id
42
+ - ig
43
+ - is
44
+ - it
45
+ - iw
46
+ - ja
47
+ - jv
48
+ - ka
49
+ - ki
50
+ - kk
51
+ - km
52
+ - ko
53
+ - la
54
+ - lb
55
+ - ln
56
+ - lo
57
+ - lt
58
+ - lv
59
+ - mi
60
+ - mr
61
+ - ms
62
+ - mt
63
+ - my
64
+ - 'no'
65
+ - oc
66
+ - pa
67
+ - pl
68
+ - pt
69
+ - qu
70
+ - ro
71
+ - ru
72
+ - sa
73
+ - sc
74
+ - sd
75
+ - sg
76
+ - sk
77
+ - sl
78
+ - sm
79
+ - so
80
+ - sq
81
+ - sr
82
+ - ss
83
+ - sv
84
+ - sw
85
+ - ta
86
+ - te
87
+ - th
88
+ - ti
89
+ - tl
90
+ - tn
91
+ - tpi
92
+ - tr
93
+ - ts
94
+ - tw
95
+ - uk
96
+ - ur
97
+ - uz
98
+ - vi
99
+ - war
100
+ - wo
101
+ - xh
102
+ - yo
103
+ - zh
104
+ - zu
105
+ base_model:
106
+ - Qwen/Qwen2.5-7B-Instruct
107
+ - timm/ViT-SO400M-14-SigLIP-384
108
+ pipeline_tag: image-text-to-text
109
  ---
110
 
111
+ # Centurio Qwen
 
 
 
 
112
 
113
  ## Model Details
114
 
 
116
 
117
  <!-- Provide a longer summary of what this model is. -->
118
 
119
+ - **Model type:** Centurio is an open-source multilingual large vision-language model.
120
+ - **Training Data:** COMING SOON
121
+ - **Languages:** The model was trained with the following 100 languages: `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
122
+ `
123
+ - **License:** This work is released under the Apache 2.0 license.
 
 
 
 
124
 
125
+ ### Model Sources
126
 
127
  <!-- Provide the basic links for the model. -->
128
 
129
+ - **Repository:** []
130
+ - **Paper:** []
131
+ - **Demo:** []
132
 
133
  ## Uses
134
 
 
138
 
139
  <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
140
 
141
+ The model can be used directly through the `transformers` library with our custom code.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
142
 
143
+ ```python
144
+ from transformers import AutoModelForCausalLM, AutoProcessor
145
+ import timm
146
+ from PIL import Image
147
+ import requests
148
 
149
+ url = "https://upload.wikimedia.org/wikipedia/commons/b/bd/Golden_Retriever_Dukedestiny01_drvd.jpg"
150
+ image = Image.open(requests.get(url, stream=True).raw)
151
 
152
+ model_name = "WueNLP/centurio_qwen"
153
 
154
+ processor = AutoProcessor.from_pretrained(model_name, trust_remote_code=True)
155
 
156
+ ## Appearance of images in the prompt are indicates with '<image_placeholder>'!
157
+ prompt = "<image_placeholder>\nBriefly describe the image in German."
158
 
159
+ messages = [
160
+ {"role": "system", "content": "You are a helpful assistant."}, # This is the system prompt used during our training.
161
+ {"role": "user", "content": prompt}
162
+ ]
163
 
164
+ text = processor.apply_chat_template(
165
+ messages,
166
+ tokenize=False,
167
+ add_generation_prompt=True
168
+ )
169
 
170
+ model = AutoModelForCausalLM.from_pretrained(
171
+ model_name,
172
+ trust_remote_code=True
173
+ )
174
 
175
+ model_inputs = processor(text=[text], images=[image] return_tensors="pt").to(model.device)
176
 
177
+ generated_ids = model.generate(
178
+ **model_inputs,
179
+ max_new_tokens=128
180
+ )
181
 
182
+ generated_ids = [
183
+ output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
184
+ ]
185
 
186
+ response = processor.batch_decode(generated_ids, skip_special_tokens=True)[0]
187
 
188
+ ```
189
 
190
+ #### Multiple Images
191
+ We natively support multi-image inputs. You only have to 1) include more `<image_placeholder>` while 2) passing all images of the *entire batch* as a flat list:
192
 
193
+ ```python
194
+ [...]
195
+ # Variables reused from above.
196
 
197
+ image_multi_1, image_multi_2 = [...] # prepare additional images
198
 
199
+ prompt_multi = "What is the difference between the following images?\n<image_placeholder><image_placeholder>\nAnswer in German."
200
 
201
+ messages_multi = [
202
+ {"role": "system", "content": "You are a helpful assistant."},
203
+ {"role": "user", "content": prompt_multi}
204
+ ]
205
 
206
+ text_multi = processor.apply_chat_template(
207
+ messages,
208
+ tokenize=False,
209
+ add_generation_prompt=True
210
+ )
211
 
212
+ model_inputs = processor(text=[text, text_multi], images=[image, image_multi_1, image_multi_2] return_tensors="pt").to(model.device)
213
 
214
+ generated_ids = model.generate(
215
+ **model_inputs,
216
+ max_new_tokens=128
217
+ )
218
 
219
+ [...]
220
 
221
+ ```
222
 
 
223
 
224
 
225
 
226
+ ## Bias, Risks, and Limitations
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
227
 
228
+ - General biases, risks, and limitations of large vision-language models like hallucinations or biases from training data apply.
229
+ - This is a research project and *not* recommended for production use.
230
+ - Multilingual: Performance and generation quality can differ widely between languages.
231
+ - OCR: Model struggles both with small text and writing in non-Latin scripts.
232
 
 
233
 
234
+ ## Citation
235
 
236
  <!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->
237
 
238
  **BibTeX:**
239
 
240
+ ```
241
+ @article{centurio2025,
242
+ title={TODO},
243
+ author={TODO},
244
+ year={2024},
245
+ journal={arXiv preprint arXiv:TODO},
246
+ url={TODO}
247
+ }
248
+ ```