maxsonderby commited on
Commit
b066188
·
verified ·
1 Parent(s): 7fc415e

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +180 -3
README.md CHANGED
@@ -1,3 +1,180 @@
1
- ---
2
- license: llama3.1
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language:
3
+ - en
4
+ - de
5
+ - fr
6
+ - it
7
+ - pt
8
+ - hi
9
+ license: llama3.1
10
+ library_name: transformers
11
+ pipeline_tag: text-classification
12
+ tags:
13
+ - facebook
14
+ - meta
15
+ - pytorch
16
+ - llama
17
+ - brand-safety
18
+ - classification
19
+ model-index:
20
+ - name: vision-1-mini
21
+ results:
22
+ - task:
23
+ type: text-classification
24
+ name: Brand Safety Classification
25
+ metrics:
26
+ - type: accuracy
27
+ value: 0.95
28
+ name: Classification Accuracy
29
+ datasets:
30
+ - BrandSafe-16k
31
+ metrics:
32
+ - accuracy
33
+ base_model: meta-llama/Llama-2-8b-chat
34
+ model_size: "4.58 GiB"
35
+ parameters: "8.03B"
36
+ quantization: "GGUF V3"
37
+ architectures:
38
+ - LlamaForCausalLM
39
+ model_parameters:
40
+ block_count: 32
41
+ context_length: 131072
42
+ embedding_length: 4096
43
+ feed_forward_length: 14336
44
+ attention_heads: 32
45
+ kv_heads: 8
46
+ rope_freq_base: 500000
47
+ vocab_size: 128256
48
+ hardware:
49
+ recommended: "Apple Silicon"
50
+ memory:
51
+ cpu_kv_cache: "992.00 MiB"
52
+ metal_kv_cache: "32.00 MiB"
53
+ metal_compute: "560.00 MiB"
54
+ cpu_compute: "560.01 MiB"
55
+ inference:
56
+ load_time: "3.27s"
57
+ device: "Metal (Apple M3 Pro)"
58
+ memory_footprint:
59
+ cpu: "4552.80 MiB"
60
+ metal: "132.50 MiB"
61
+ ---
62
+ # vision-1-mini
63
+
64
+ Vision-1-mini is an optimized 8B parameter model based on Llama 3.1, specifically designed for brand safety classification. This model is particularly optimized for Apple Silicon devices and provides efficient, accurate brand safety assessments using the BrandSafe-16k classification system.
65
+
66
+ ## Model Details
67
+
68
+ - **Model Type:** Brand Safety Classifier
69
+ - **Base Model:** Meta Llama 3.1 8B Instruct
70
+ - **Parameters:** 8.03 billion
71
+ - **Architecture:** Llama
72
+ - **Quantization:** Q4_K
73
+ - **Size:** 4.58 GiB (4.89 BPW)
74
+ - **License:** Llama 3.1
75
+
76
+ ## Performance Metrics
77
+
78
+ - **Load Time:** 3.27 seconds (on Apple M3 Pro)
79
+ - **Memory Usage:**
80
+ - CPU Buffer: 4552.80 MiB
81
+ - Metal Buffer: 132.50 MiB
82
+ - KV Cache: 1024.00 MiB (512.00 MiB K, 512.00 MiB V)
83
+ - Compute Buffer: 560.00 MiB
84
+
85
+ ## Hardware Compatibility
86
+
87
+ ### Apple Silicon Optimizations
88
+ - Optimized for Metal/MPS
89
+ - Unified Memory Architecture support
90
+ - SIMD group reduction and matrix multiplication optimizations
91
+ - Efficient layer offloading (1/33 layers to GPU)
92
+
93
+ ### System Requirements
94
+ - Recommended Memory: 12GB+
95
+ - GPU: Apple Silicon preferred (M1/M2/M3 series)
96
+ - Storage: 5GB free space
97
+
98
+ ## Classification Categories
99
+
100
+ The model classifies content into the following categories:
101
+ 1. B1-PROFANITY - Contains profane or vulgar language
102
+ 2. B2-OFFENSIVE_SLANG - Contains offensive slang or derogatory terms
103
+ 3. B3-COMPETITOR - Mentions or promotes competing brands
104
+ 4. B4-BRAND_CRITICISM - Contains criticism or negative feedback about brands
105
+ 5. B5-MISLEADING - Contains misleading or deceptive information
106
+ 6. B6-POLITICAL - Contains political content or bias
107
+ 7. B7-RELIGIOUS - Contains religious content or references
108
+ 8. B8-CONTROVERSIAL - Contains controversial topics or discussions
109
+ 9. B9-ADULT - Contains adult or mature content
110
+ 10. B10-VIOLENCE - Contains violent content or references
111
+ 11. B11-SUBSTANCE - Contains references to drugs, alcohol, or substances
112
+ 12. B12-HATE - Contains hate speech or discriminatory content
113
+ 13. B13-STEREOTYPE - Contains stereotypical representations
114
+ 14. B14-BIAS - Shows bias against groups or individuals
115
+ 15. B15-UNPROFESSIONAL - Contains unprofessional content or behavior
116
+ 16. B16-MANIPULATION - Contains manipulative content or tactics
117
+ 17. SAFE - Contains no brand safety concerns
118
+
119
+ ## Usage
120
+
121
+ ```python
122
+ from transformers import AutoModelForCausalLM, AutoTokenizer
123
+
124
+ # Load model
125
+ model = AutoModelForCausalLM.from_pretrained("maxsonderby/vision-1-mini",
126
+ device_map="auto",
127
+ torch_dtype=torch.float16,
128
+ low_cpu_mem_usage=True)
129
+ tokenizer = AutoTokenizer.from_pretrained("maxsonderby/vision-1-mini")
130
+
131
+ # Example usage
132
+ text = "Your text here"
133
+ inputs = tokenizer(text, return_tensors="pt").to(model.device)
134
+ outputs = model.generate(**inputs,
135
+ max_new_tokens=1,
136
+ temperature=0.1,
137
+ top_p=0.9)
138
+ result = tokenizer.decode(outputs[0], skip_special_tokens=True)
139
+ ```
140
+
141
+ ## Model Architecture
142
+
143
+ - **Attention Mechanism:**
144
+ - Head Count: 32
145
+ - KV Head Count: 8
146
+ - Layer Count: 32
147
+ - Embedding Length: 4096
148
+ - Feed Forward Length: 14336
149
+ - Context Length: 2048 (optimized from 131072)
150
+ - RoPE Base Frequency: 500000
151
+ - Dimension Count: 128
152
+
153
+ ## Training & Fine-tuning
154
+
155
+ This model is fine-tuned on brand safety classification tasks using the BrandSafe-16k dataset. The model uses an optimized context window of 2048 tokens and is configured for precise, deterministic outputs with:
156
+ - Temperature: 0.1
157
+ - Top-p: 0.9
158
+ - Batch Size: 512
159
+ - Thread Count: 8
160
+
161
+ ## Limitations
162
+
163
+ - The model is optimized for shorter content classification (up to 2048 tokens)
164
+ - Performance may vary on non-Apple Silicon hardware
165
+ - The model focuses solely on brand safety classification and may not be suitable for other tasks
166
+ - Classification accuracy may vary based on content complexity and context
167
+
168
+ ## Citation
169
+
170
+ If you use this model in your research, please cite:
171
+ ```
172
+ @misc{vision-1-mini,
173
+ author = {Max Sonderby},
174
+ title = {Vision-1-Mini: Optimized Brand Safety Classification Model},
175
+ year = {2024},
176
+ publisher = {Hugging Face},
177
+ journal = {Hugging Face Model Hub},
178
+ howpublished = {\url{https://huggingface.co/maxsonderby/vision-1-mini}}
179
+ }
180
+ ```