Mungert commited on
Commit
26b05de
·
verified ·
1 Parent(s): c637ae4

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +464 -0
README.md ADDED
@@ -0,0 +1,464 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: cc-by-nc-4.0
3
+ pipeline_tag: image-text-to-text
4
+ library_name: transformers
5
+ base_model:
6
+ - google/paligemma-3b-mix-448
7
+ - Qwen/Qwen2.5-0.5B-Instruct
8
+ - google/siglip-so400m-patch14-384
9
+ base_model_relation: merge
10
+ language:
11
+ - multilingual
12
+ tags:
13
+ - eagle
14
+ - VLM
15
+ ---
16
+
17
+ # <span style="color: #7FFF7F;">Eagle2-1B GGUF Models</span>
18
+
19
+
20
+ ## <span style="color: #7F7FFF;">Model Generation Details</span>
21
+
22
+ This model was generated using [llama.cpp](https://github.com/ggerganov/llama.cpp) at commit [`b9c3eefd`](https://github.com/ggerganov/llama.cpp/commit/b9c3eefde1b67104bd993485ff38dd62abe9d70c).
23
+
24
+
25
+
26
+
27
+
28
+
29
+ ---
30
+
31
+ <a href="https://readyforquantum.com/huggingface_gguf_selection_guide.html" style="color: #7FFF7F;">
32
+ Click here to get info on choosing the right GGUF model format
33
+ </a>
34
+
35
+ ---
36
+
37
+
38
+
39
+ <!--Begin Original Model Card-->
40
+
41
+
42
+
43
+ # Eagle-2
44
+
45
+
46
+ [\[📂 GitHub\]](https://github.com/NVlabs/EAGLE) [\[📜 Eagle2 Tech Report\]](http://arxiv.org/abs/2501.14818)
47
+ [\[🤗 HF Demo\]](https://huggingface.co/spaces/nvidia/Eagle2-Demo)
48
+
49
+ # News:
50
+ - We update the model arch to `eagle_2_5_vl` to support `generate` feature.
51
+
52
+ ## Introduction
53
+
54
+ We are thrilled to release our latest Eagle2 series Vision-Language Model. Open-source Vision-Language Models (VLMs) have made significant strides in narrowing the gap with proprietary models. However, critical details about data strategies and implementation are often missing, limiting reproducibility and innovation. In this project, we focus on VLM post-training from a data-centric perspective, sharing insights into building effective data strategies from scratch. By combining these strategies with robust training recipes and model design, we introduce Eagle2, a family of performant VLMs. Our work aims to empower the open-source community to develop competitive VLMs with transparent processes.
55
+
56
+
57
+ In this repo, we are open-sourcing Eagle2-1B, a compact and efficient model designed for scenarios requiring fast inference and minimal computational resources, without compromising essential performance
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+ ## Model Zoo
67
+ We provide the following models:
68
+
69
+ | model name | LLM | Vision | Max Length| HF Link|
70
+ | ----------- | ------- |---------|-|-|
71
+ | Eagle2-1B | [Qwen2.5-0.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct) | Siglip | 16K| [🤗 link](https://huggingface.co/NVIDIA/Eagle2-1B)|
72
+ | Eagle2-2B | [Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) | Siglip | 16K| [🤗 link](https://huggingface.co/NVIDIA/Eagle2-2B)|
73
+ | Eagle2-9B | [Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) | Siglip+ConvNext | 16K| [🤗 link](https://huggingface.co/NVIDIA/Eagle2-9B)|
74
+
75
+ ## Benchmark Results
76
+ | Benchmark | LLaVa-One-Vision-0.5B | InternVL2-1B | InternVL2.5-1B |Qwen2-VL-2B| Eagle2-1B|
77
+ | :--------------------------: | :------------------: | :----------------: | :----------: |:----------: |:----------: |
78
+ | DocVQA<sub>test</sub> | 70.0 | 81.7 | 84.8 |90.1|81.8|
79
+ | ChartQA<sub>test</sub> | 61.4 | 72.9 | 75.9 |73.0|77.0|
80
+ | InfoVQA<sub>test</sub> | 41.8 | 50.9 | 56.0 |65.5|54.8|
81
+ | TextVQA<sub>val</sub> | - | 70.0 | 72.0 |79.7|76.6|
82
+ | OCRBench | 565 | 754 | 785 |809|767|
83
+ | MME<sub>sum</sub> | 1438.0 | 1794.4 | 1950.5 | 1872.0| 1790.2|
84
+ | RealWorldQA | 55.6 | 50.3 | 57.5 |62.6|55.4|
85
+ | AI2D<sub>test</sub> | 57.1 | 64.1 | 69.3 | 74.7 |70.9|
86
+ | MMMU<sub>val</sub> | 31.4 | 36.7 | 40.9 |41.1|38.8|
87
+ | MMVet<sub>GPT-4-Turbo</sub> | 32.2 | 32.7 | 48.8 | 49.5|40.9| HallBench<sub>avg</sub> | 27.9 | 34.0 | 39.0 |**41.7**|35.3
88
+ | MathVista<sub>testmini</sub> | 33.8 | 37.7 | 43.2 |43.0|45.3|
89
+ | MMstar | 37.7 | 45.7 | 50.1|48.0|48.5|
90
+
91
+
92
+
93
+ ## Quick Start
94
+
95
+
96
+
97
+ We provide a [inference script](./demo.py) to help you quickly start using the model. We support different input types:
98
+ - pure text input
99
+ - single image input
100
+ - multiple image input
101
+ - video input
102
+
103
+ ### Install the dependencies
104
+
105
+ ```bash
106
+ pip install transformers
107
+ pip install flash-attn
108
+ ```
109
+
110
+
111
+ ### single image
112
+
113
+ ```python
114
+ from PIL import Image
115
+ import requests
116
+ from transformers import AutoProcessor, AutoModel
117
+ import torch
118
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
119
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
120
+ processor.tokenizer.padding_side = "left"
121
+
122
+ messages = [
123
+ {
124
+ "role": "user",
125
+ "content": [
126
+ {
127
+ "type": "image",
128
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
129
+ },
130
+ {"type": "text", "text": "Describe this image."},
131
+ ],
132
+ }
133
+ ]
134
+
135
+ text_list = [processor.apply_chat_template(
136
+ messages, tokenize=False, add_generation_prompt=True
137
+ )]
138
+ image_inputs, video_inputs = processor.process_vision_info(messages)
139
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
140
+ inputs = inputs.to("cuda")
141
+ model = model.to("cuda")
142
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
143
+ output_text = processor.batch_decode(
144
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
145
+ )
146
+ print(output_text)
147
+ ```
148
+
149
+ ### stream generation
150
+
151
+ ```python
152
+ from PIL import Image
153
+ import requests
154
+ from transformers import AutoProcessor, AutoModel, AutoTokenizer
155
+ import torch
156
+
157
+ from transformers import TextIteratorStreamer
158
+ import threading
159
+
160
+
161
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, attn_implementation='flash_attention_2', torch_dtype=torch.bfloat16)
162
+ tokenizer = AutoTokenizer.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
163
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
164
+ processor.tokenizer.padding_side = "left"
165
+
166
+ messages = [
167
+ {
168
+ "role": "user",
169
+ "content": [
170
+ {
171
+ "type": "image",
172
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
173
+ },
174
+ {"type": "text", "text": "Describe this image."},
175
+ ],
176
+ }
177
+ ]
178
+
179
+ text_list = [processor.apply_chat_template(
180
+ messages, tokenize=False, add_generation_prompt=True
181
+ )]
182
+ image_inputs, video_inputs = processor.process_vision_info(messages)
183
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
184
+ inputs = inputs.to("cuda")
185
+ model = model.to("cuda")
186
+
187
+ streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
188
+
189
+ generation_kwargs = dict(
190
+ **inputs,
191
+ streamer=streamer,
192
+ max_new_tokens=1024,
193
+ do_sample=True,
194
+ top_p=0.95,
195
+ temperature=0.8
196
+ )
197
+ thread = threading.Thread(target=model.generate, kwargs=generation_kwargs)
198
+ thread.start()
199
+
200
+
201
+ for new_text in streamer:
202
+ print(new_text, end="", flush=True)
203
+ ```
204
+
205
+ ### multiple-images
206
+
207
+ ```python
208
+ from PIL import Image
209
+ import requests
210
+ from transformers import AutoProcessor, AutoModel
211
+ import torch
212
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
213
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
214
+ processor.tokenizer.padding_side = "left"
215
+
216
+ messages = [
217
+ {
218
+ "role": "user",
219
+ "content": [
220
+ {
221
+ "type": "image",
222
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
223
+ },
224
+ {
225
+ "type": "image",
226
+ "image": "https://www.nvidia.com/content/dam/en-zz/Solutions/about-nvidia/logo-and-brand/[email protected]",
227
+ },
228
+ {"type": "text", "text": "Describe these two images."},
229
+ ],
230
+ }
231
+ ]
232
+
233
+ text_list = [processor.apply_chat_template(
234
+ messages, tokenize=False, add_generation_prompt=True
235
+ )]
236
+ image_inputs, video_inputs = processor.process_vision_info(messages)
237
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
238
+ inputs = inputs.to("cuda")
239
+ model = model.to("cuda")
240
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
241
+ output_text = processor.batch_decode(
242
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
243
+ )
244
+ print(output_text)
245
+ ```
246
+
247
+ ### single video
248
+
249
+ ```python
250
+
251
+ from PIL import Image
252
+ import requests
253
+ from transformers import AutoProcessor, AutoModel
254
+ import torch
255
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
256
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
257
+ processor.tokenizer.padding_side = "left"
258
+
259
+ messages = [
260
+ {
261
+ "role": "user",
262
+ "content": [
263
+ {
264
+ "type": "video",
265
+ "video": "../Eagle2-8B/space_woaudio.mp4",
266
+ },
267
+ {"type": "text", "text": "Describe this video."},
268
+ ],
269
+ }
270
+ ]
271
+
272
+ text_list = [processor.apply_chat_template(
273
+ messages, tokenize=False, add_generation_prompt=True
274
+ )]
275
+ image_inputs, video_inputs, video_kwargs = processor.process_vision_info(messages, return_video_kwargs=True)
276
+
277
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True, videos_kwargs=video_kwargs)
278
+ inputs = inputs.to("cuda")
279
+ model = model.to("cuda")
280
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
281
+ output_text = processor.batch_decode(
282
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
283
+ )
284
+ print(output_text)
285
+
286
+ ```
287
+
288
+ ### multieple videos
289
+
290
+ ```python
291
+ from PIL import Image
292
+ import requests
293
+ from transformers import AutoProcessor, AutoModel
294
+ import torch
295
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
296
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
297
+ processor.tokenizer.padding_side = "left"
298
+
299
+ messages = [
300
+ {
301
+ "role": "user",
302
+ "content": [
303
+ {
304
+ "type": "video",
305
+ "video": "../Eagle2-8B/space_woaudio.mp4",
306
+ "nframes": 10,
307
+ },
308
+ {
309
+ "type": "video",
310
+ "video": "../Eagle2-8B/video_ocr.mp4",
311
+ "nframes": 10,
312
+ },
313
+ {"type": "text", "text": "Describe these two videos respectively."},
314
+ ],
315
+ }
316
+ ]
317
+
318
+ text_list = [processor.apply_chat_template(
319
+ messages, tokenize=False, add_generation_prompt=True
320
+ )]
321
+ image_inputs, video_inputs, video_kwargs = processor.process_vision_info(messages, return_video_kwargs=True)
322
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True, videos_kwargs=video_kwargs)
323
+ inputs = inputs.to("cuda")
324
+ model = model.to("cuda")
325
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
326
+ output_text = processor.batch_decode(
327
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
328
+ )
329
+ print(output_text)
330
+ ```
331
+
332
+ ### batch inference
333
+
334
+ ```python
335
+ from PIL import Image
336
+ import requests
337
+ from transformers import AutoProcessor, AutoModel
338
+ import torch
339
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
340
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
341
+ processor.tokenizer.padding_side = "left"
342
+
343
+ messages1 = [
344
+ {
345
+ "role": "user",
346
+ "content": [
347
+ {
348
+ "type": "image",
349
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
350
+ },
351
+ {"type": "text", "text": "Describe this image."},
352
+ ],
353
+ }
354
+ ]
355
+
356
+ messages2 = [
357
+ {
358
+ "role": "user",
359
+ "content": [
360
+ {
361
+ "type": "image",
362
+ "image": "https://www.nvidia.com/content/dam/en-zz/Solutions/about-nvidia/logo-and-brand/[email protected]",
363
+ },
364
+ {"type": "text", "text": "Describe this image."},
365
+ ],
366
+ }
367
+ ]
368
+
369
+ text_list = [processor.apply_chat_template(
370
+ messages, tokenize=False, add_generation_prompt=True
371
+ ) for messages in [messages1, messages2]]
372
+ image_inputs, video_inputs = processor.process_vision_info([messages1, messages2])
373
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
374
+ inputs = inputs.to("cuda")
375
+ model = model.to("cuda")
376
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
377
+ output_text = processor.batch_decode(
378
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
379
+ )
380
+ print(output_text)
381
+ ```
382
+
383
+
384
+ ## TODO
385
+ - [ ] Support vLLM Inference
386
+ - [ ] Provide AWQ Quantization Weights
387
+ - [ ] Provide fine-tuning scripts
388
+
389
+
390
+ ## License/Terms of Use
391
+ - The code is released under the Apache 2.0 license as found in the [LICENSE](https://huggingface.co/NVEagle/Eagle-X5-13B-Chat/blob/main/LICENSE) file.
392
+ - The pretrained model weights are released under the [Creative Commons Attribution: Non-Commercial 4.0 International](https://spdx.org/licenses/CC-BY-NC-4.0) <br>
393
+ - The service is a research preview intended for non-commercial use only, and is subject to the following licenses and terms:
394
+ - Model License of Qwen2.5-0.5B-Instruct: [Apache-2.0](https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct/blob/main/LICENSE)
395
+ - Model License of PaliGemma: [Gemma license](https://ai.google.dev/gemma/terms)
396
+
397
+
398
+
399
+ ## Citation
400
+
401
+ ## Ethical Considerations
402
+ NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
403
+
404
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
405
+
406
+
407
+ <!--End Original Model Card-->
408
+
409
+ ---
410
+
411
+ # <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
412
+
413
+ Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
414
+
415
+ 👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
416
+
417
+
418
+ The full Open Source Code for the Quantum Network Monitor Service available at my github repos ( repos with NetworkMonitor in the name) : [Source Code Quantum Network Monitor](https://github.com/Mungert69). You will also find the code I use to quantize the models if you want to do it yourself [GGUFModelBuilder](https://github.com/Mungert69/GGUFModelBuilder)
419
+
420
+ 💬 **How to test**:
421
+ Choose an **AI assistant type**:
422
+ - `TurboLLM` (GPT-4.1-mini)
423
+ - `HugLLM` (Hugginface Open-source models)
424
+ - `TestLLM` (Experimental CPU-only)
425
+
426
+ ### **What I’m Testing**
427
+ I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
428
+ - **Function calling** against live network services
429
+ - **How small can a model go** while still handling:
430
+ - Automated **Nmap security scans**
431
+ - **Quantum-readiness checks**
432
+ - **Network Monitoring tasks**
433
+
434
+ 🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
435
+ - ✅ **Zero-configuration setup**
436
+ - ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
437
+ - 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
438
+
439
+ ### **Other Assistants**
440
+ 🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
441
+ - **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
442
+ - **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
443
+ - **Real-time network diagnostics and monitoring**
444
+ - **Security Audits**
445
+ - **Penetration testing** (Nmap/Metasploit)
446
+
447
+ 🔵 **HugLLM** – Latest Open-source models:
448
+ - 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
449
+
450
+ ### 💡 **Example commands you could test**:
451
+ 1. `"Give me info on my websites SSL certificate"`
452
+ 2. `"Check if my server is using quantum safe encyption for communication"`
453
+ 3. `"Run a comprehensive security audit on my server"`
454
+ 4. '"Create a cmd processor to .. (what ever you want)" Note you need to install a [Quantum Network Monitor Agent](https://readyforquantum.com/Download/?utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme) to run the .net code on. This is a very flexible and powerful feature. Use with caution!
455
+
456
+ ### Final Word
457
+
458
+ I fund the servers used to create these model files, run the Quantum Network Monitor service, and pay for inference from Novita and OpenAI—all out of my own pocket. All the code behind the model creation and the Quantum Network Monitor project is [open source](https://github.com/Mungert69). Feel free to use whatever you find helpful.
459
+
460
+ If you appreciate the work, please consider [buying me a coffee](https://www.buymeacoffee.com/mahadeva) ☕. Your support helps cover service costs and allows me to raise token limits for everyone.
461
+
462
+ I'm also open to job opportunities or sponsorship.
463
+
464
+ Thank you! 😊