Mungert commited on
Commit
6cd32db
·
verified ·
1 Parent(s): c3572db

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +465 -0
README.md ADDED
@@ -0,0 +1,465 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-1.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-2B 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
+ [\[📂 GitHub\]](https://github.com/NVlabs/EAGLE) [\[📜 Eagle2 Tech Report\]](http://arxiv.org/abs/2501.14818)
46
+ [\[🤗 HF Demo\]](https://huggingface.co/spaces/nvidia/Eagle2-Demo)
47
+
48
+ # News:
49
+ - We update the model arch to `eagle_2_5_vl` to support `generate` feature.
50
+
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
+
58
+ In this repo, we are open-sourcing Eagle2-2B, a lightweight model that achieves remarkable efficiency and speed while maintaining solid performance.
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+ ## Model Zoo
68
+ We provide the following models:
69
+
70
+ | model name | LLM | Vision | Max Length| HF Link|
71
+ | ----------- | ------- |---------|-|-|
72
+ | 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)|
73
+ | 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)|
74
+ | Eagle2-9B | [Qwen2.5-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-7B-Instruct) | Siglip+ConvNext | 16K| [🤗 link](https://huggingface.co/NVIDIA/Eagle2-9B)|
75
+
76
+ ## Benchmark Results
77
+ | Benchmark | InternVL2-2B | InternVL2.5-2B | InternVL2-4B |Qwen2-VL-2B| Eagle2-2B|
78
+ | :--------------------------: | :------------------: | :----------------: | :----------: |:----------: |:----------: |
79
+ | DocVQA<sub>test</sub> | 86.9 | 88.7 | 89.2 |90.1|88.0|
80
+ | ChartQA<sub>test</sub> | 76.2 | 79.2 | 81.5 |73.0|82.0|
81
+ | InfoVQA<sub>test</sub> | 58.9 | 60.9 | 67.0 |65.5|65.8|
82
+ | TextVQA<sub>val</sub> | 73.4 | 74.3 | 74.4 |79.7|79.1|
83
+ | OCRBench | 784 | 804 | 788 |809|818|
84
+ | MME<sub>sum</sub> | 1876.8 | 2138.2 | 2059.8 |1872.0 | 2109.8
85
+ | RealWorldQA | 57.3 | 60.1 | 60.7 |62.6|63.1|
86
+ | AI2D<sub>test</sub> | 74.1 | 74.9 | 74.7 | 78.9 |79.3|
87
+ | MMMU<sub>val</sub> | 36.3 | 43.6 | 47.9 |41.1|43.1|
88
+ | MMVet<sub>GPT-4-Turbo</sub> | 39.5 | 60.8 | 51.0 | 49.5|53.8|
89
+ | HallBench<sub>avg</sub> | 37.9 | 42.6 | 41.9 |41.7|45.8
90
+ | MathVista<sub>testmini</sub> | 46.3 | 51.3 | 58.6 |43.0|54.7|
91
+ | MMstar | 50.1 | 53.7 | 54.3|48.0|56.4|
92
+
93
+
94
+
95
+ ## Quick Start
96
+
97
+
98
+
99
+ We provide a [inference script](./demo.py) to help you quickly start using the model. We support different input types:
100
+ - pure text input
101
+ - single image input
102
+ - multiple image input
103
+ - video input
104
+
105
+ ### Install the dependencies
106
+
107
+ ```bash
108
+ pip install transformers
109
+ pip install flash-attn
110
+ ```
111
+
112
+
113
+ ### single image
114
+
115
+ ```python
116
+ from PIL import Image
117
+ import requests
118
+ from transformers import AutoProcessor, AutoModel
119
+ import torch
120
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
121
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
122
+ processor.tokenizer.padding_side = "left"
123
+
124
+ messages = [
125
+ {
126
+ "role": "user",
127
+ "content": [
128
+ {
129
+ "type": "image",
130
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
131
+ },
132
+ {"type": "text", "text": "Describe this image."},
133
+ ],
134
+ }
135
+ ]
136
+
137
+ text_list = [processor.apply_chat_template(
138
+ messages, tokenize=False, add_generation_prompt=True
139
+ )]
140
+ image_inputs, video_inputs = processor.process_vision_info(messages)
141
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
142
+ inputs = inputs.to("cuda")
143
+ model = model.to("cuda")
144
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
145
+ output_text = processor.batch_decode(
146
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
147
+ )
148
+ print(output_text)
149
+ ```
150
+
151
+ ### stream generation
152
+
153
+ ```python
154
+ from PIL import Image
155
+ import requests
156
+ from transformers import AutoProcessor, AutoModel, AutoTokenizer
157
+ import torch
158
+
159
+ from transformers import TextIteratorStreamer
160
+ import threading
161
+
162
+
163
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, attn_implementation='flash_attention_2', torch_dtype=torch.bfloat16)
164
+ tokenizer = AutoTokenizer.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
165
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
166
+ processor.tokenizer.padding_side = "left"
167
+
168
+ messages = [
169
+ {
170
+ "role": "user",
171
+ "content": [
172
+ {
173
+ "type": "image",
174
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
175
+ },
176
+ {"type": "text", "text": "Describe this image."},
177
+ ],
178
+ }
179
+ ]
180
+
181
+ text_list = [processor.apply_chat_template(
182
+ messages, tokenize=False, add_generation_prompt=True
183
+ )]
184
+ image_inputs, video_inputs = processor.process_vision_info(messages)
185
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
186
+ inputs = inputs.to("cuda")
187
+ model = model.to("cuda")
188
+
189
+ streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
190
+
191
+ generation_kwargs = dict(
192
+ **inputs,
193
+ streamer=streamer,
194
+ max_new_tokens=1024,
195
+ do_sample=True,
196
+ top_p=0.95,
197
+ temperature=0.8
198
+ )
199
+ thread = threading.Thread(target=model.generate, kwargs=generation_kwargs)
200
+ thread.start()
201
+
202
+
203
+ for new_text in streamer:
204
+ print(new_text, end="", flush=True)
205
+ ```
206
+
207
+ ### multiple-images
208
+
209
+ ```python
210
+ from PIL import Image
211
+ import requests
212
+ from transformers import AutoProcessor, AutoModel
213
+ import torch
214
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
215
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
216
+ processor.tokenizer.padding_side = "left"
217
+
218
+ messages = [
219
+ {
220
+ "role": "user",
221
+ "content": [
222
+ {
223
+ "type": "image",
224
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
225
+ },
226
+ {
227
+ "type": "image",
228
+ "image": "https://www.nvidia.com/content/dam/en-zz/Solutions/about-nvidia/logo-and-brand/[email protected]",
229
+ },
230
+ {"type": "text", "text": "Describe these two images."},
231
+ ],
232
+ }
233
+ ]
234
+
235
+ text_list = [processor.apply_chat_template(
236
+ messages, tokenize=False, add_generation_prompt=True
237
+ )]
238
+ image_inputs, video_inputs = processor.process_vision_info(messages)
239
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
240
+ inputs = inputs.to("cuda")
241
+ model = model.to("cuda")
242
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
243
+ output_text = processor.batch_decode(
244
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
245
+ )
246
+ print(output_text)
247
+ ```
248
+
249
+ ### single video
250
+
251
+ ```python
252
+
253
+ from PIL import Image
254
+ import requests
255
+ from transformers import AutoProcessor, AutoModel
256
+ import torch
257
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
258
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
259
+ processor.tokenizer.padding_side = "left"
260
+
261
+ messages = [
262
+ {
263
+ "role": "user",
264
+ "content": [
265
+ {
266
+ "type": "video",
267
+ "video": "../Eagle2-8B/space_woaudio.mp4",
268
+ },
269
+ {"type": "text", "text": "Describe this video."},
270
+ ],
271
+ }
272
+ ]
273
+
274
+ text_list = [processor.apply_chat_template(
275
+ messages, tokenize=False, add_generation_prompt=True
276
+ )]
277
+ image_inputs, video_inputs, video_kwargs = processor.process_vision_info(messages, return_video_kwargs=True)
278
+
279
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True, videos_kwargs=video_kwargs)
280
+ inputs = inputs.to("cuda")
281
+ model = model.to("cuda")
282
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
283
+ output_text = processor.batch_decode(
284
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
285
+ )
286
+ print(output_text)
287
+
288
+ ```
289
+
290
+ ### multieple videos
291
+
292
+ ```python
293
+ from PIL import Image
294
+ import requests
295
+ from transformers import AutoProcessor, AutoModel
296
+ import torch
297
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
298
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
299
+ processor.tokenizer.padding_side = "left"
300
+
301
+ messages = [
302
+ {
303
+ "role": "user",
304
+ "content": [
305
+ {
306
+ "type": "video",
307
+ "video": "../Eagle2-8B/space_woaudio.mp4",
308
+ "nframes": 10,
309
+ },
310
+ {
311
+ "type": "video",
312
+ "video": "../Eagle2-8B/video_ocr.mp4",
313
+ "nframes": 10,
314
+ },
315
+ {"type": "text", "text": "Describe these two videos respectively."},
316
+ ],
317
+ }
318
+ ]
319
+
320
+ text_list = [processor.apply_chat_template(
321
+ messages, tokenize=False, add_generation_prompt=True
322
+ )]
323
+ image_inputs, video_inputs, video_kwargs = processor.process_vision_info(messages, return_video_kwargs=True)
324
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True, videos_kwargs=video_kwargs)
325
+ inputs = inputs.to("cuda")
326
+ model = model.to("cuda")
327
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
328
+ output_text = processor.batch_decode(
329
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
330
+ )
331
+ print(output_text)
332
+ ```
333
+
334
+ ### batch inference
335
+
336
+ ```python
337
+ from PIL import Image
338
+ import requests
339
+ from transformers import AutoProcessor, AutoModel
340
+ import torch
341
+ model = AutoModel.from_pretrained("nvidia/Eagle2-1B",trust_remote_code=True, torch_dtype=torch.bfloat16)
342
+ processor = AutoProcessor.from_pretrained("nvidia/Eagle2-1B", trust_remote_code=True, use_fast=True)
343
+ processor.tokenizer.padding_side = "left"
344
+
345
+ messages1 = [
346
+ {
347
+ "role": "user",
348
+ "content": [
349
+ {
350
+ "type": "image",
351
+ "image": "https://www.ilankelman.org/stopsigns/australia.jpg",
352
+ },
353
+ {"type": "text", "text": "Describe this image."},
354
+ ],
355
+ }
356
+ ]
357
+
358
+ messages2 = [
359
+ {
360
+ "role": "user",
361
+ "content": [
362
+ {
363
+ "type": "image",
364
+ "image": "https://www.nvidia.com/content/dam/en-zz/Solutions/about-nvidia/logo-and-brand/[email protected]",
365
+ },
366
+ {"type": "text", "text": "Describe this image."},
367
+ ],
368
+ }
369
+ ]
370
+
371
+ text_list = [processor.apply_chat_template(
372
+ messages, tokenize=False, add_generation_prompt=True
373
+ ) for messages in [messages1, messages2]]
374
+ image_inputs, video_inputs = processor.process_vision_info([messages1, messages2])
375
+ inputs = processor(text = text_list, images=image_inputs, videos=video_inputs, return_tensors="pt", padding=True)
376
+ inputs = inputs.to("cuda")
377
+ model = model.to("cuda")
378
+ generated_ids = model.generate(**inputs, max_new_tokens=1024)
379
+ output_text = processor.batch_decode(
380
+ generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False
381
+ )
382
+ print(output_text)
383
+ ```
384
+
385
+ ## TODO
386
+ - [ ] Support vLLM Inference
387
+ - [ ] Provide AWQ Quantization Weights
388
+ - [ ] Provide fine-tuning scripts
389
+
390
+
391
+ ## License/Terms of Use
392
+ - 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.
393
+ - 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>
394
+ - The service is a research preview intended for non-commercial use only, and is subject to the following licenses and terms:
395
+ - Model License of Qwen2.5-1.5B-Instruct: [Apache-2.0](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct/blob/main/LICENSE)
396
+ - Model License of PaliGemma: [Gemma license](https://ai.google.dev/gemma/terms)
397
+
398
+
399
+
400
+ ## Citation
401
+
402
+ ## Ethical Considerations
403
+ 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.
404
+
405
+ Please report security vulnerabilities or NVIDIA AI Concerns [here](https://www.nvidia.com/en-us/support/submit-security-vulnerability/).
406
+
407
+
408
+ <!--End Original Model Card-->
409
+
410
+ ---
411
+
412
+ # <span id="testllm" style="color: #7F7FFF;">🚀 If you find these models useful</span>
413
+
414
+ Help me test my **AI-Powered Quantum Network Monitor Assistant** with **quantum-ready security checks**:
415
+
416
+ 👉 [Quantum Network Monitor](https://readyforquantum.com/?assistant=open&utm_source=huggingface&utm_medium=referral&utm_campaign=huggingface_repo_readme)
417
+
418
+
419
+ 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)
420
+
421
+ 💬 **How to test**:
422
+ Choose an **AI assistant type**:
423
+ - `TurboLLM` (GPT-4.1-mini)
424
+ - `HugLLM` (Hugginface Open-source models)
425
+ - `TestLLM` (Experimental CPU-only)
426
+
427
+ ### **What I’m Testing**
428
+ I’m pushing the limits of **small open-source models for AI network monitoring**, specifically:
429
+ - **Function calling** against live network services
430
+ - **How small can a model go** while still handling:
431
+ - Automated **Nmap security scans**
432
+ - **Quantum-readiness checks**
433
+ - **Network Monitoring tasks**
434
+
435
+ 🟡 **TestLLM** – Current experimental model (llama.cpp on 2 CPU threads on huggingface docker space):
436
+ - ✅ **Zero-configuration setup**
437
+ - ⏳ 30s load time (slow inference but **no API costs**) . No token limited as the cost is low.
438
+ - 🔧 **Help wanted!** If you’re into **edge-device AI**, let’s collaborate!
439
+
440
+ ### **Other Assistants**
441
+ 🟢 **TurboLLM** – Uses **gpt-4.1-mini** :
442
+ - **It performs very well but unfortunatly OpenAI charges per token. For this reason tokens usage is limited.
443
+ - **Create custom cmd processors to run .net code on Quantum Network Monitor Agents**
444
+ - **Real-time network diagnostics and monitoring**
445
+ - **Security Audits**
446
+ - **Penetration testing** (Nmap/Metasploit)
447
+
448
+ 🔵 **HugLLM** – Latest Open-source models:
449
+ - 🌐 Runs on Hugging Face Inference API. Performs pretty well using the lastest models hosted on Novita.
450
+
451
+ ### 💡 **Example commands you could test**:
452
+ 1. `"Give me info on my websites SSL certificate"`
453
+ 2. `"Check if my server is using quantum safe encyption for communication"`
454
+ 3. `"Run a comprehensive security audit on my server"`
455
+ 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!
456
+
457
+ ### Final Word
458
+
459
+ 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.
460
+
461
+ 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.
462
+
463
+ I'm also open to job opportunities or sponsorship.
464
+
465
+ Thank you! 😊