Sri-Vigneshwar-DJ
commited on
Update README.md
Browse files
README.md
CHANGED
@@ -1,96 +1,66 @@
|
|
|
|
|
|
1 |
library_name: transformers
|
2 |
-
license:
|
3 |
-
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
-
|
7 |
-
|
8 |
-
meta-llama/
|
9 |
-
google/siglip-so400m-patch14-384
|
10 |
|
|
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
To fine-tune Llama3.3 70B VLM on a specific task, you can follow the fine-tuning tutorial.
|
15 |
-
<!-- todo: add link to fine-tuning tutorial -->
|
16 |
-
Technical Summary
|
17 |
-
Llama3.3 70B VLM leverages the powerful Llama-3.3-70B language model to provide a comprehensive multimodal experience. It introduces several changes compared to previous models:
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
pythonCopyimport torch
|
26 |
-
from PIL import Image
|
27 |
-
from transformers import AutoProcessor, AutoModelForVision2Seq
|
28 |
-
from transformers.image_utils import load_image
|
29 |
|
30 |
-
|
31 |
|
32 |
-
|
33 |
-
|
34 |
-
image2 = load_image("https://huggingface.co/spaces/merve/chameleon-7b/resolve/main/bee.jpg")
|
35 |
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
torch_dtype=torch.bfloat16,
|
41 |
-
_attn_implementation="flash_attention_2" if DEVICE == "cuda" else "eager",
|
42 |
-
).to(DEVICE)
|
43 |
|
44 |
-
#
|
45 |
-
messages = [
|
46 |
-
{
|
47 |
-
"role": "user",
|
48 |
-
"content": [
|
49 |
-
{"type": "image"},
|
50 |
-
{"type": "image"},
|
51 |
-
{"type": "text", "text": "Can you describe the two images?"}
|
52 |
-
]
|
53 |
-
},
|
54 |
-
]
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
generated_ids,
|
65 |
-
skip_special_tokens=True,
|
66 |
-
)
|
67 |
|
68 |
-
|
69 |
-
"""
|
70 |
-
Assistant: The first image shows a green statue of the Statue of Liberty standing on a stone pedestal in front of a body of water.
|
71 |
-
The statue is holding a torch in its right hand and a tablet in its left hand. The water is calm and there are no boats or other objects visible.
|
72 |
-
The sky is clear and there are no clouds. The second image shows a bee on a pink flower.
|
73 |
-
The bee is black and yellow and is collecting pollen from the flower. The flower is surrounded by green leaves.
|
74 |
-
"""
|
75 |
-
Our Approach
|
76 |
-
Instruct SAM
|
77 |
-
Model optimizations
|
78 |
-
Precision: For better performance, load and run the model in half-precision (torch.float16 or torch.bfloat16) if your hardware supports it.
|
79 |
-
pythonCopyfrom transformers import AutoModelForVision2Seq
|
80 |
-
import torch
|
81 |
|
82 |
-
|
83 |
-
|
84 |
-
torch_dtype=torch.bfloat16
|
85 |
-
).to("cuda")
|
86 |
-
You can also load Llama3.3 70B VLM with 4/8-bit quantization using bitsandbytes, torchao or Quanto. Refer to this page for other options.
|
87 |
-
pythonCopyfrom transformers import AutoModelForVision2Seq, BitsAndBytesConfig
|
88 |
-
import torch
|
89 |
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
|
|
|
1 |
+
---
|
2 |
+
base_model: meta-llama/Llama-3.3-70B-Instruct
|
3 |
library_name: transformers
|
4 |
+
license: other
|
5 |
+
tags:
|
6 |
+
- llama-cpp
|
7 |
+
- Llama-3.3
|
8 |
+
- Llama-3.3-70B
|
9 |
+
- Llama
|
10 |
+
- Llama-3.3-70B-Instruct
|
11 |
+
- 4Bit
|
12 |
+
- GGUF
|
13 |
+
datasets: hawky_market_research_prompts
|
14 |
+
---
|
15 |
|
16 |
+
# Sri-Vigneshwar-DJ/Llama-3.3-70B-4bit
|
17 |
+
This model was converted to GGUF format from [`AIDC-AI/Marco-o1`](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) using llama.cpp
|
18 |
+
Refer to the [original model card](https://huggingface.co/meta-llama/Llama-3.3-70B-Instruct) for more details on the model.
|
|
|
19 |
|
20 |
+
## Use with llama.cpp
|
21 |
+
Install llama.cpp through brew (works on Mac and Linux) from []
|
22 |
|
23 |
+
```bash
|
24 |
+
brew install llama.cpp or !git clone https://github.com/ggerganov/llama.cpp.git
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
```
|
27 |
+
Invoke the llama.cpp server or the CLI.
|
28 |
|
29 |
+
### CLI:
|
30 |
+
```bash
|
31 |
+
! /content/llama.cpp/llama-cli -m ./Llama-3.3-70B-4bit -n 90 --repeat_penalty 1.0 --color -i -r "User:" -f /content/llama.cpp/prompts/chat-with-bob.txt
|
|
|
|
|
|
|
|
|
32 |
|
33 |
+
or
|
34 |
|
35 |
+
llama-cli --hf-repo Sri-Vigneshwar-DJ/meta-llama/Llama-3.3-70B-4bit --hf-file FP8.gguf -p "Create Meta Ads Templates"
|
36 |
+
```
|
|
|
37 |
|
38 |
+
### Server:
|
39 |
+
```bash
|
40 |
+
llama-server --hf-repo Sri-Vigneshwar-DJ/Llama-3.3-70B-4bit --hf-file FP8.gguf -c 2048
|
41 |
+
```
|
|
|
|
|
|
|
42 |
|
43 |
+
Note: You can also use this checkpoint directly through the [usage steps](https://github.com/ggerganov/llama.cpp?tab=readme-ov-file#usage) listed in the Llama.cpp repo as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
+
Step 1: Clone llama.cpp from GitHub.
|
46 |
+
```
|
47 |
+
git clone https://github.com/ggerganov/llama.cpp
|
48 |
+
```
|
49 |
|
50 |
+
Step 2: Move into the llama.cpp folder and build it with `LLAMA_CURL=1` flag or ''!make GGML_OPENBLAS=1' along with other hardware-specific flags (for ex: LLAMA_CUDA=1 for Nvidia GPUs on Linux).
|
51 |
+
```
|
52 |
+
cd llama.cpp && LLAMA_CURL=1 make
|
|
|
|
|
|
|
53 |
|
54 |
+
or
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
|
56 |
+
!make GGML_OPENBLAS=1
|
57 |
+
```
|
|
|
|
|
|
|
|
|
|
|
58 |
|
59 |
+
Step 3: Run inference through the main binary.
|
60 |
+
```
|
61 |
+
./llama-cli --hf-repo Sri-Vigneshwar-DJ/Llama-3.3-70B-4bit --hf-file FP8.gguf -p "The meaning to life and the universe is"
|
62 |
+
```
|
63 |
+
or
|
64 |
+
```
|
65 |
+
./llama-server --hf-repo Sri-Vigneshwar-DJ/Llama-3.3-70B-4bit --hf-file sFP8.gguf -c 2048
|
66 |
+
```
|