XudongShen
commited on
Commit
·
1ec63c5
1
Parent(s):
8fed6e8
from Apple/DFN-public
Browse files- LICENSE +39 -0
- README.md +31 -0
- config.json +165 -0
- merges.txt +0 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +24 -0
- tokenizer.json +0 -0
- tokenizer_config.json +34 -0
- vocab.json +0 -0
LICENSE
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
Copyright (C) 2023 Apple Inc. All Rights Reserved.
|
2 |
+
|
3 |
+
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
|
4 |
+
Inc. ("Apple") in consideration of your agreement to the following
|
5 |
+
terms, and your use, installation, modification or redistribution of
|
6 |
+
this Apple software constitutes acceptance of these terms. If you do
|
7 |
+
not agree with these terms, please do not use, install, modify or
|
8 |
+
redistribute this Apple software.
|
9 |
+
|
10 |
+
In consideration of your agreement to abide by the following terms, and
|
11 |
+
subject to these terms, Apple grants you a personal, non-exclusive
|
12 |
+
license, under Apple's copyrights in this original Apple software (the
|
13 |
+
"Apple Software"), to use, reproduce, modify and redistribute the Apple
|
14 |
+
Software, with or without modifications, in source and/or binary forms;
|
15 |
+
provided that if you redistribute the Apple Software in its entirety and
|
16 |
+
without modifications, you must retain this notice and the following
|
17 |
+
text and disclaimers in all such redistributions of the Apple Software.
|
18 |
+
Neither the name, trademarks, service marks or logos of Apple Inc. may
|
19 |
+
be used to endorse or promote products derived from the Apple Software
|
20 |
+
without specific prior written permission from Apple. Except as
|
21 |
+
expressly stated in this notice, no other rights or licenses, express or
|
22 |
+
implied, are granted by Apple herein, including but not limited to any
|
23 |
+
patent rights that may be infringed by your derivative works or by other
|
24 |
+
works in which the Apple Software may be incorporated.
|
25 |
+
|
26 |
+
The Apple Software is provided by Apple on an "AS IS" basis. APPLE
|
27 |
+
MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
|
28 |
+
THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
|
29 |
+
FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
|
30 |
+
OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
|
31 |
+
|
32 |
+
IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
|
33 |
+
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
34 |
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
35 |
+
INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
|
36 |
+
MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
|
37 |
+
AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
|
38 |
+
STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
|
39 |
+
POSSIBILITY OF SUCH DAMAGE.
|
README.md
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: other
|
3 |
+
license_name: apple-sample-code-license
|
4 |
+
license_link: LICENSE
|
5 |
+
---
|
6 |
+
|
7 |
+
A CLIP (Contrastive Language-Image Pre-training) ViT-B/32 model trained on Conceptual Captions 12M, Conceptual Captions 3M, and Shutterstock 15M.
|
8 |
+
Data Filtering Networks (DFNs) are small networks used to automatically filter large pools of uncurated data.
|
9 |
+
This model is a DFN trained on publicly available data.
|
10 |
+
|
11 |
+
This model has been converted to PyTorch from the original JAX checkpoints from Axlearn (https://github.com/apple/axlearn).
|
12 |
+
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
- **Model Type:** Contrastive Image-Text, Zero-Shot Image Classification.
|
17 |
+
- **Dataset:** CC12M + CC3M + SS15M
|
18 |
+
- **Papers:**
|
19 |
+
- Data Filtering Networks: https://arxiv.org/abs/2309.17425
|
20 |
+
- **Examples Seen:** 1.28B
|
21 |
+
|
22 |
+
## Citation
|
23 |
+
```bibtex
|
24 |
+
@article{fang2023data,
|
25 |
+
title={Data Filtering Networks},
|
26 |
+
author={Fang, Alex and Jose, Albin Madappally and Jain, Amit and Schmidt, Ludwig and Toshev, Alexander and Shankar, Vaishaal},
|
27 |
+
journal={arXiv preprint arXiv:2309.17425},
|
28 |
+
year={2023}
|
29 |
+
}
|
30 |
+
|
31 |
+
```
|
config.json
ADDED
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_commit_hash": null,
|
3 |
+
"architectures": [
|
4 |
+
"CLIPModel"
|
5 |
+
],
|
6 |
+
"initializer_factor": 1.0,
|
7 |
+
"logit_scale_init_value": 2.6592,
|
8 |
+
"model_type": "clip",
|
9 |
+
"projection_dim": 512,
|
10 |
+
"text_config": {
|
11 |
+
"_name_or_path": "",
|
12 |
+
"add_cross_attention": false,
|
13 |
+
"architectures": null,
|
14 |
+
"attention_dropout": 0.0,
|
15 |
+
"bad_words_ids": null,
|
16 |
+
"begin_suppress_tokens": null,
|
17 |
+
"bos_token_id": 0,
|
18 |
+
"chunk_size_feed_forward": 0,
|
19 |
+
"cross_attention_hidden_size": null,
|
20 |
+
"decoder_start_token_id": null,
|
21 |
+
"diversity_penalty": 0.0,
|
22 |
+
"do_sample": false,
|
23 |
+
"early_stopping": false,
|
24 |
+
"encoder_no_repeat_ngram_size": 0,
|
25 |
+
"eos_token_id": 49407,
|
26 |
+
"exponential_decay_length_penalty": null,
|
27 |
+
"finetuning_task": null,
|
28 |
+
"forced_bos_token_id": null,
|
29 |
+
"forced_eos_token_id": null,
|
30 |
+
"hidden_act": "quick_gelu",
|
31 |
+
"hidden_size": 512,
|
32 |
+
"id2label": {
|
33 |
+
"0": "LABEL_0",
|
34 |
+
"1": "LABEL_1"
|
35 |
+
},
|
36 |
+
"initializer_factor": 1.0,
|
37 |
+
"initializer_range": 0.02,
|
38 |
+
"intermediate_size": 2048,
|
39 |
+
"is_decoder": false,
|
40 |
+
"is_encoder_decoder": false,
|
41 |
+
"label2id": {
|
42 |
+
"LABEL_0": 0,
|
43 |
+
"LABEL_1": 1
|
44 |
+
},
|
45 |
+
"layer_norm_eps": 1e-05,
|
46 |
+
"length_penalty": 1.0,
|
47 |
+
"max_length": 20,
|
48 |
+
"max_position_embeddings": 77,
|
49 |
+
"min_length": 0,
|
50 |
+
"model_type": "clip_text_model",
|
51 |
+
"no_repeat_ngram_size": 0,
|
52 |
+
"num_attention_heads": 8,
|
53 |
+
"num_beam_groups": 1,
|
54 |
+
"num_beams": 1,
|
55 |
+
"num_hidden_layers": 12,
|
56 |
+
"num_return_sequences": 1,
|
57 |
+
"output_attentions": false,
|
58 |
+
"output_hidden_states": false,
|
59 |
+
"output_scores": false,
|
60 |
+
"pad_token_id": 49408,
|
61 |
+
"prefix": null,
|
62 |
+
"problem_type": null,
|
63 |
+
"projection_dim": 512,
|
64 |
+
"pruned_heads": {},
|
65 |
+
"remove_invalid_values": false,
|
66 |
+
"repetition_penalty": 1.0,
|
67 |
+
"return_dict": true,
|
68 |
+
"return_dict_in_generate": false,
|
69 |
+
"sep_token_id": null,
|
70 |
+
"suppress_tokens": null,
|
71 |
+
"task_specific_params": null,
|
72 |
+
"temperature": 1.0,
|
73 |
+
"tf_legacy_loss": false,
|
74 |
+
"tie_encoder_decoder": false,
|
75 |
+
"tie_word_embeddings": true,
|
76 |
+
"tokenizer_class": null,
|
77 |
+
"top_k": 50,
|
78 |
+
"top_p": 1.0,
|
79 |
+
"torch_dtype": null,
|
80 |
+
"torchscript": false,
|
81 |
+
"transformers_version": "4.27.1",
|
82 |
+
"typical_p": 1.0,
|
83 |
+
"use_bfloat16": false,
|
84 |
+
"vocab_size": 49409
|
85 |
+
},
|
86 |
+
"torch_dtype": "float32",
|
87 |
+
"transformers_version": null,
|
88 |
+
"vision_config": {
|
89 |
+
"_name_or_path": "",
|
90 |
+
"add_cross_attention": false,
|
91 |
+
"architectures": null,
|
92 |
+
"attention_dropout": 0.0,
|
93 |
+
"bad_words_ids": null,
|
94 |
+
"begin_suppress_tokens": null,
|
95 |
+
"bos_token_id": null,
|
96 |
+
"chunk_size_feed_forward": 0,
|
97 |
+
"cross_attention_hidden_size": null,
|
98 |
+
"decoder_start_token_id": null,
|
99 |
+
"diversity_penalty": 0.0,
|
100 |
+
"do_sample": false,
|
101 |
+
"early_stopping": false,
|
102 |
+
"encoder_no_repeat_ngram_size": 0,
|
103 |
+
"eos_token_id": null,
|
104 |
+
"exponential_decay_length_penalty": null,
|
105 |
+
"finetuning_task": null,
|
106 |
+
"forced_bos_token_id": null,
|
107 |
+
"forced_eos_token_id": null,
|
108 |
+
"hidden_act": "quick_gelu",
|
109 |
+
"hidden_size": 768,
|
110 |
+
"id2label": {
|
111 |
+
"0": "LABEL_0",
|
112 |
+
"1": "LABEL_1"
|
113 |
+
},
|
114 |
+
"image_size": 224,
|
115 |
+
"initializer_factor": 1.0,
|
116 |
+
"initializer_range": 0.02,
|
117 |
+
"intermediate_size": 3072,
|
118 |
+
"is_decoder": false,
|
119 |
+
"is_encoder_decoder": false,
|
120 |
+
"label2id": {
|
121 |
+
"LABEL_0": 0,
|
122 |
+
"LABEL_1": 1
|
123 |
+
},
|
124 |
+
"layer_norm_eps": 1e-05,
|
125 |
+
"length_penalty": 1.0,
|
126 |
+
"max_length": 20,
|
127 |
+
"min_length": 0,
|
128 |
+
"model_type": "clip_vision_model",
|
129 |
+
"no_repeat_ngram_size": 0,
|
130 |
+
"num_attention_heads": 12,
|
131 |
+
"num_beam_groups": 1,
|
132 |
+
"num_beams": 1,
|
133 |
+
"num_channels": 3,
|
134 |
+
"num_hidden_layers": 12,
|
135 |
+
"num_return_sequences": 1,
|
136 |
+
"output_attentions": false,
|
137 |
+
"output_hidden_states": false,
|
138 |
+
"output_scores": false,
|
139 |
+
"pad_token_id": null,
|
140 |
+
"patch_size": 32,
|
141 |
+
"prefix": null,
|
142 |
+
"problem_type": null,
|
143 |
+
"projection_dim": 512,
|
144 |
+
"pruned_heads": {},
|
145 |
+
"remove_invalid_values": false,
|
146 |
+
"repetition_penalty": 1.0,
|
147 |
+
"return_dict": true,
|
148 |
+
"return_dict_in_generate": false,
|
149 |
+
"sep_token_id": null,
|
150 |
+
"suppress_tokens": null,
|
151 |
+
"task_specific_params": null,
|
152 |
+
"temperature": 1.0,
|
153 |
+
"tf_legacy_loss": false,
|
154 |
+
"tie_encoder_decoder": false,
|
155 |
+
"tie_word_embeddings": true,
|
156 |
+
"tokenizer_class": null,
|
157 |
+
"top_k": 50,
|
158 |
+
"top_p": 1.0,
|
159 |
+
"torch_dtype": null,
|
160 |
+
"torchscript": false,
|
161 |
+
"transformers_version": "4.27.1",
|
162 |
+
"typical_p": 1.0,
|
163 |
+
"use_bfloat16": false
|
164 |
+
}
|
165 |
+
}
|
merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:0d2f82e2fb2fd0ff068582a1d29c8cd92ec9a8621b822dba792795016259e661
|
3 |
+
size 605243981
|
special_tokens_map.json
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"bos_token": {
|
3 |
+
"content": "<|startoftext|>",
|
4 |
+
"lstrip": false,
|
5 |
+
"normalized": true,
|
6 |
+
"rstrip": false,
|
7 |
+
"single_word": false
|
8 |
+
},
|
9 |
+
"eos_token": {
|
10 |
+
"content": "<|endoftext|>",
|
11 |
+
"lstrip": false,
|
12 |
+
"normalized": true,
|
13 |
+
"rstrip": false,
|
14 |
+
"single_word": false
|
15 |
+
},
|
16 |
+
"pad_token": "<|endoftext|>",
|
17 |
+
"unk_token": {
|
18 |
+
"content": "<|endoftext|>",
|
19 |
+
"lstrip": false,
|
20 |
+
"normalized": true,
|
21 |
+
"rstrip": false,
|
22 |
+
"single_word": false
|
23 |
+
}
|
24 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"add_prefix_space": false,
|
3 |
+
"bos_token": {
|
4 |
+
"__type": "AddedToken",
|
5 |
+
"content": "<|startoftext|>",
|
6 |
+
"lstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"rstrip": false,
|
9 |
+
"single_word": false
|
10 |
+
},
|
11 |
+
"do_lower_case": true,
|
12 |
+
"eos_token": {
|
13 |
+
"__type": "AddedToken",
|
14 |
+
"content": "<|endoftext|>",
|
15 |
+
"lstrip": false,
|
16 |
+
"normalized": true,
|
17 |
+
"rstrip": false,
|
18 |
+
"single_word": false
|
19 |
+
},
|
20 |
+
"errors": "replace",
|
21 |
+
"model_max_length": 77,
|
22 |
+
"name_or_path": "openai/clip-vit-large-patch14",
|
23 |
+
"pad_token": "<|endoftext|>",
|
24 |
+
"special_tokens_map_file": "./special_tokens_map.json",
|
25 |
+
"tokenizer_class": "CLIPTokenizer",
|
26 |
+
"unk_token": {
|
27 |
+
"__type": "AddedToken",
|
28 |
+
"content": "<|endoftext|>",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": true,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false
|
33 |
+
}
|
34 |
+
}
|
vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|