mrfakename joanrodai commited on
Commit
f2f17df
·
verified ·
0 Parent(s):

Duplicate from starvector/starvector-8b-im2svg

Browse files

Co-authored-by: Juan A. Rodriguez <[email protected]>

.gitattributes ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.bin filter=lfs diff=lfs merge=lfs -text
4
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
5
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
6
+ *.ftz filter=lfs diff=lfs merge=lfs -text
7
+ *.gz filter=lfs diff=lfs merge=lfs -text
8
+ *.h5 filter=lfs diff=lfs merge=lfs -text
9
+ *.joblib filter=lfs diff=lfs merge=lfs -text
10
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
11
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
12
+ *.model filter=lfs diff=lfs merge=lfs -text
13
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
14
+ *.npy filter=lfs diff=lfs merge=lfs -text
15
+ *.npz filter=lfs diff=lfs merge=lfs -text
16
+ *.onnx filter=lfs diff=lfs merge=lfs -text
17
+ *.ot filter=lfs diff=lfs merge=lfs -text
18
+ *.parquet filter=lfs diff=lfs merge=lfs -text
19
+ *.pb filter=lfs diff=lfs merge=lfs -text
20
+ *.pickle filter=lfs diff=lfs merge=lfs -text
21
+ *.pkl filter=lfs diff=lfs merge=lfs -text
22
+ *.pt filter=lfs diff=lfs merge=lfs -text
23
+ *.pth filter=lfs diff=lfs merge=lfs -text
24
+ *.rar filter=lfs diff=lfs merge=lfs -text
25
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
26
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
27
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
28
+ *.tar filter=lfs diff=lfs merge=lfs -text
29
+ *.tflite filter=lfs diff=lfs merge=lfs -text
30
+ *.tgz filter=lfs diff=lfs merge=lfs -text
31
+ *.wasm filter=lfs diff=lfs merge=lfs -text
32
+ *.xz filter=lfs diff=lfs merge=lfs -text
33
+ *.zip filter=lfs diff=lfs merge=lfs -text
34
+ *.zst filter=lfs diff=lfs merge=lfs -text
35
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ library_name: transformers
3
+ license: apache-2.0
4
+ language:
5
+ - en
6
+ ---
7
+
8
+ # Model Card for StarVector
9
+
10
+ ![image/png](https://cdn-uploads.huggingface.co/production/uploads/65c27c201b5b51dd4814fcd2/ULL7FkrMHA38I8olD7nEh.png)
11
+
12
+ StarVector is a foundation model for generating Scalable Vector Graphics (SVG) code from images and text. It utilizes a Vision-Language Modeling architecture to understand both visual and textual inputs, enabling high-quality vectorization and text-guided SVG creation.
13
+
14
+ ## Model Details
15
+
16
+ ### Model Description
17
+
18
+ This is the model card for the StarVector model, a 🤗 transformers model. StarVector is a foundation model for generating Scalable Vector Graphics (SVG) code from images and text. It utilizes a Vision-Language Modeling architecture to understand both visual and textual inputs, enabling high-quality vectorization and text-guided SVG creation.
19
+
20
+ - **Developed by:** ServiceNow Research, Mila - Quebec AI Institute, ETS, Montreal.
21
+ - **Shared by :** Juan A Rodriguez, Abhay Puri, Shubham Agarwal, Issam H. Laradji, Sai Rajeswar, Pau Rodriguez, David Vazquez, Christopher Pal, Marco Pedersoli.
22
+ - **Model type:** Vision-Language Model for SVG Generation.
23
+ - **Language(s) (NLP):** English.
24
+ - **License:** Apache 2.0
25
+
26
+ ### Model Architecture
27
+
28
+ The StarVector architecture integrates an image encoder and a Large Language Model (LLM) Adapter to generate SVG code from both image and text inputs. Images are first converted into embeddings using a Vision Transformer (ViT), after which the LLM Adapter maps these embeddings into the LLM's embedding space to create visual tokens. Text prompts are handled through the LLM’s tokenizer and embedder. This unified multimodal approach ensures precise and contextually rich SVG output.
29
+
30
+ <figure>
31
+ <img src="https://cdn-uploads.huggingface.co/production/uploads/65c27c201b5b51dd4814fcd2/IVGxASfNr8wfu-agH9Nqj.png" alt="Figure 2: StarVector Architecture">
32
+ <figcaption>Figure 2: a) StarVector Architecture: StarVector projects images into embeddings via an image encoder, then maps these embeddings to the LLM hidden space using an LLM Adapter, generating Visual Tokens. Text conditioning is achieved with the LLM's tokenizer and embedder. The model learns to map token sequences (visual or textual) to SVG code. The symbol ⊕ denotes mutually exclusive operations (image-to- SVG or text-to-SVG), while ‖ indicates sequence concatenation. Figure 2: b)Vision Model and Adapter: The image encoder employs a Vision Transformer (ViT) to process image patches sequentially. The LLM Adapter non-linearly projects embeddings into visual tokens for LLM integration.</figcaption>
33
+ </figure>
34
+
35
+ ### Model Sources
36
+
37
+ - **Repository:** [https://github.com/joanrod/star-vector](https://github.com/joanrod/star-vector)
38
+ - **Paper:** [https://arxiv.org/abs/2312.11556](https://arxiv.org/abs/2312.11556)
39
+
40
+ ## Uses
41
+
42
+ ### Direct Use
43
+
44
+ Image-to-SVG generation, Text-to-SVG generation.
45
+
46
+ ### Downstream Use
47
+
48
+ Creation of icons, logotypes, technical diagrams, and other vector graphics.
49
+
50
+ ### Out-of-Scope Use
51
+
52
+ Generating realistic photographic images or complex 3D graphics.
53
+
54
+ ## Bias, Risks, and Limitations
55
+
56
+ Potential biases may exist in the model due to the composition of the training data (SVG-Stack). The model's ability to perfectly vectorize all types of images and interpret all textual instructions may have limitations. Users should be aware of these potential issues, especially in critical applications.
57
+
58
+ ### Recommendations
59
+
60
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. Further investigation into the model's behavior across different types of inputs is recommended.
61
+
62
+ ## How to Get Started with the Model
63
+
64
+ Use the code below to get started with the model.
65
+
66
+ ```Python
67
+ from PIL import Image
68
+ from transformers import AutoModelForCausalLM, AutoTokenizer, AutoProcessor
69
+ from starvector.data.util import process_and_rasterize_svg
70
+ import torch
71
+
72
+ model_name = "starvector/starvector-8b-im2svg"
73
+
74
+ starvector = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.float16, trust_remote_code=True)
75
+ processor = starvector.model.processor
76
+ tokenizer = starvector.model.svg_transformer.tokenizer
77
+
78
+ starvector.cuda()
79
+ starvector.eval()
80
+
81
+ image_pil = Image.open('assets/examples/sample-18.png')
82
+
83
+ image = processor(image_pil, return_tensors="pt")['pixel_values'].cuda()
84
+ if not image.shape[0] == 1:
85
+ image = image.squeeze(0)
86
+ batch = {"image": image}
87
+
88
+ raw_svg = starvector.generate_im2svg(batch, max_length=4000)[0]
89
+ svg, raster_image = process_and_rasterize_svg(raw_svg)
90
+ ```
91
+
92
+ ## Training Details
93
+
94
+ ### Training Data
95
+ SVG-Stack: A dataset of over 2 million SVG samples.
96
+
97
+ ### Training Procedure
98
+ The model utilizes a Vision-Language Modeling architecture. Images are projected into embeddings via an image encoder, then mapped to the LLM hidden space using an LLM Adapter, generating Visual Tokens. Text conditioning is achieved with the LLM's tokenizer and embedder. The model learns to map token sequences (visual or textual) to SVG code.
99
+
100
+ ## Evaluation
101
+ ### Testing Data & Factors
102
+
103
+ #### Testing Data
104
+ SVG-Bench
105
+
106
+ #### Factors
107
+ SVG-Stack, SVG-Fonts, SVG-Icons, SVG-Emoji, SVG-Diagrams.
108
+
109
+ ## Models
110
+
111
+ StarVector models achieve state-of-the-art performance on SVG generation tasks
112
+
113
+ We provide [Hugging Face 🤗 model checkpoints](https://huggingface.co/collections/starvector/starvector-models-6783b22c7bd4b43d13cb5289) for image2SVG vectorization, for 💫 StarVector-8B and 💫 StarVector-1B. These are the results on SVG-Bench, using the DinoScore metric.
114
+
115
+ | Method | SVG-Stack | SVG-Fonts | SVG-Icons | SVG-Emoji | SVG-Diagrams |
116
+ |--------------------|-----------|-----------|-----------|-----------|--------------|
117
+ | AutoTrace | 0.942 | 0.954 | 0.946 | 0.975 | 0.874 |
118
+ | Potrace | 0.898 | 0.967 | 0.972 | 0.882 | 0.875 |
119
+ | VTracer | 0.954 | 0.964 | 0.940 | 0.981 | 0.882 |
120
+ | Im2Vec | 0.692 | 0.733 | 0.754 | 0.732 | - |
121
+ | LIVE | 0.934 | 0.956 | 0.959 | 0.969 | 0.870 |
122
+ | DiffVG | 0.810 | 0.821 | 0.952 | 0.814 | 0.822 |
123
+ | GPT-4-V | 0.852 | 0.842 | 0.848 | 0.850 | - |
124
+ | 💫 **StarVector-1B** | 0.926 | 0.978 | 0.975 | 0.929 | 0.943 |
125
+ | 💫 **StarVector-8B** | 0.966 | 0.982 | 0.984 | 0.981 | 0.959 |
126
+
127
+ **Note:** StarVector models will not work for natural images or illustrations, as they have not been trained on those images. They excel in vectorizing icons, logotypes, technical diagrams, graphs, and charts.
128
+
129
+ As shown in the table above, StarVector-8B achieves the highest performance across all benchmark datasets, demonstrating its effectiveness in generating high-quality SVG code from images. The model's ability to understand and reproduce complex vector graphics makes it particularly valuable for applications requiring precise vectorization of icons, logos, and technical diagrams.
130
+
131
+ ## Summary
132
+ StarVector represents a significant advancement in the field of vector graphics generation. By combining the power of vision-language models with a comprehensive training dataset, we've created a system that can accurately translate images into high-quality SVG code. The model's performance on SVG-Bench demonstrates its effectiveness across a wide range of vector graphics tasks.
133
+
134
+ We believe that StarVector will enable new applications in design, illustration, and technical documentation, making vector graphics more accessible and easier to create. We invite the research community to build upon our work and explore new directions in this exciting field.
135
+
136
+ For more details, please refer to our [paper](https://arxiv.org/abs/2312.11556) and explore our [code](https://github.com/joanrod/star-vector) repository.
137
+
138
+ ## BibTeX entry and citation info
139
+
140
+ ```
141
+ @misc{rodriguez2024starvector,
142
+ title={StarVector: Generating Scalable Vector Graphics Code from Images and Text},
143
+ author={Juan A. Rodriguez and Abhay Puri and Shubham Agarwal and Issam H. Laradji and Pau Rodriguez and Sai Rajeswar and David Vazquez and Christopher Pal and Marco Pedersoli},
144
+ year={2024},
145
+ eprint={2312.11556},
146
+ archivePrefix={arXiv},
147
+ primaryClass={cs.CV},
148
+ url={https://arxiv.org/abs/2312.11556},
149
+ }
150
+ ```
added_tokens.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "<caption-start>": 49155,
3
+ "<image-start>": 49154,
4
+ "<svg-end>": 49156,
5
+ "<svg-start>": 49153,
6
+ "[PAD]": 49152
7
+ }
config.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "ServiceNow/starvector-8b-im2svg",
3
+ "adapter_norm": "layer_norm",
4
+ "architectures": [
5
+ "StarVectorForCausalLM"
6
+ ],
7
+ "auto_map": {
8
+ "AutoConfig": "starvector_arch.StarVectorConfig",
9
+ "AutoModelForCausalLM": "starvector_arch.StarVectorForCausalLM"
10
+ },
11
+ "hidden_size": 4608,
12
+ "image_encoder_type": "siglip_384",
13
+ "image_size": 384,
14
+ "init_type": "normal",
15
+ "max_length_train": 16000,
16
+ "model_type": "starvector",
17
+ "num_attention_heads": 36,
18
+ "num_hidden_layers": 32,
19
+ "num_kv_heads": 4,
20
+ "starcoder_model_name": "bigcode/starcoder2-7b",
21
+ "torch_dtype": "bfloat16",
22
+ "transformers_version": "4.40.1",
23
+ "use_cache": true,
24
+ "use_flash_attn": true,
25
+ "vocab_size": 49152
26
+ }
merges.txt ADDED
The diff for this file is too large to render. See raw diff
 
model-00001-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:5582ea9000274523b2dbaebded366db7c3155a3ec2bb8a9a3f7e1622818e6430
3
+ size 4889586776
model-00002-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:82b67f1f171150239f579372bbdec14550a8a065de22037b23ecbfef33cd686f
3
+ size 4946285040
model-00003-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6242bcd0ea466d1d8bf40922868c67571d221d37afccdc34e5f8186b42aff9a4
3
+ size 4999851312
model-00004-of-00004.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:24ea7cf0827c7919266f5c71a215f282dcc23da13643b6291d87c1c606703aa4
3
+ size 178570912
model.safetensors.index.json ADDED
The diff for this file is too large to render. See raw diff
 
preprocessor_config.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "do_convert_rgb": null,
3
+ "do_normalize": true,
4
+ "do_rescale": true,
5
+ "do_resize": true,
6
+ "image_mean": [
7
+ 0.5,
8
+ 0.5,
9
+ 0.5
10
+ ],
11
+ "image_processor_type": "SiglipImageProcessor",
12
+ "image_std": [
13
+ 0.5,
14
+ 0.5,
15
+ 0.5
16
+ ],
17
+ "processor_class": "SiglipProcessor",
18
+ "resample": 3,
19
+ "rescale_factor": 0.00392156862745098,
20
+ "size": {
21
+ "height": 384,
22
+ "width": 384
23
+ }
24
+ }
processor_config.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "image_processor": {
3
+ "type": "SiglipImageProcessor"
4
+ }
5
+ }
special_tokens_map.json ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "additional_special_tokens": [
3
+ "<|endoftext|>",
4
+ "<fim_prefix>",
5
+ "<fim_middle>",
6
+ "<fim_suffix>",
7
+ "<fim_pad>",
8
+ "<repo_name>",
9
+ "<file_sep>",
10
+ "<issue_start>",
11
+ "<issue_comment>",
12
+ "<issue_closed>",
13
+ "<jupyter_start>",
14
+ "<jupyter_text>",
15
+ "<jupyter_code>",
16
+ "<jupyter_output>",
17
+ "<jupyter_script>",
18
+ "<empty_output>",
19
+ "<code_to_intermediate>",
20
+ "<intermediate_to_code>",
21
+ "<pr>",
22
+ "<pr_status>",
23
+ "<pr_is_merged>",
24
+ "<pr_base>",
25
+ "<pr_file>",
26
+ "<pr_base_code>",
27
+ "<pr_diff>",
28
+ "<pr_diff_hunk>",
29
+ "<pr_comment>",
30
+ "<pr_event_id>",
31
+ "<pr_review>",
32
+ "<pr_review_state>",
33
+ "<pr_review_comment>",
34
+ "<pr_in_reply_to_review_id>",
35
+ "<pr_in_reply_to_comment_id>",
36
+ "<pr_diff_hunk_comment_line>",
37
+ "<NAME>",
38
+ "<EMAIL>",
39
+ "<KEY>",
40
+ "<PASSWORD>"
41
+ ],
42
+ "bos_token": {
43
+ "content": "<|endoftext|>",
44
+ "lstrip": false,
45
+ "normalized": false,
46
+ "rstrip": false,
47
+ "single_word": false
48
+ },
49
+ "eos_token": {
50
+ "content": "<|endoftext|>",
51
+ "lstrip": false,
52
+ "normalized": false,
53
+ "rstrip": false,
54
+ "single_word": false
55
+ },
56
+ "pad_token": {
57
+ "content": "[PAD]",
58
+ "lstrip": false,
59
+ "normalized": false,
60
+ "rstrip": false,
61
+ "single_word": false
62
+ },
63
+ "unk_token": {
64
+ "content": "<|endoftext|>",
65
+ "lstrip": false,
66
+ "normalized": false,
67
+ "rstrip": false,
68
+ "single_word": false
69
+ }
70
+ }
starvector_arch.py ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from transformers import (
2
+ PretrainedConfig,
3
+ PreTrainedModel
4
+ )
5
+ import torch
6
+ class StarVectorConfig(PretrainedConfig):
7
+ model_type = "starvector"
8
+
9
+ def __init__(
10
+ self,
11
+ starcoder_model_name: str = "bigcode/starcoderbase-1b",
12
+ image_encoder_type: str = "clip",
13
+ adapter_norm: str = "layer_norm",
14
+ image_size: int = 224,
15
+ max_length: int = 8192,
16
+ max_length_train: int = 8192,
17
+ use_flash_attn: bool = True,
18
+ use_cache: bool = True,
19
+ num_attention_heads: int = 16,
20
+ num_hidden_layers: int = 24,
21
+ vocab_size: int = 49152,
22
+ hidden_size: int = 2048,
23
+ num_kv_heads: int = 4,
24
+ torch_dtype: str = "bfloat16",
25
+ **kwargs,
26
+ ):
27
+ self.starcoder_model_name = starcoder_model_name
28
+ self.image_encoder_type = image_encoder_type
29
+ self.adapter_norm = adapter_norm
30
+ self.image_size = image_size
31
+ self.max_length = max_length
32
+ self.max_length_train = max_length_train
33
+ self.use_flash_attn = use_flash_attn
34
+ self.use_cache = use_cache
35
+ self.num_attention_heads = num_attention_heads
36
+ self.num_hidden_layers = num_hidden_layers
37
+ self.vocab_size = vocab_size
38
+ self.hidden_size = hidden_size
39
+ self.num_kv_heads = num_kv_heads
40
+ self.torch_dtype = torch_dtype
41
+ super().__init__(**kwargs)
42
+
43
+ class StarVectorForCausalLM(PreTrainedModel):
44
+ config_class = StarVectorConfig
45
+ _no_split_modules = []
46
+
47
+ def __init__(self, config: StarVectorConfig, **kwargs):
48
+ super().__init__(config)
49
+ starcoder_model_name = config.starcoder_model_name
50
+ if 'starcoder2' in starcoder_model_name:
51
+ from starvector.model.models.starvector_v2 import StarVectorStarCoder2
52
+ self.model = StarVectorStarCoder2(config=config, **kwargs)
53
+ else:
54
+ from starvector.model.models.starvector_v1 import StarVectorStarCoder
55
+ self.model = StarVectorStarCoder(config=config, **kwargs)
56
+
57
+ def forward(self, batch):
58
+ return self.model(batch)
59
+
60
+ def generate_im2svg(self, batch, **kwargs):
61
+ return self.model.generate_im2svg(batch, **kwargs)
62
+
63
+ def generate_im2text(self, batch, **kwargs):
64
+ return self.model.generate_im2text(batch, **kwargs)
65
+
66
+ def process_images(self, images):
67
+ return self.model.image_encoder.process_images(images)
68
+
tokenizer_config.json ADDED
@@ -0,0 +1,399 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "add_bos_token": false,
3
+ "add_prefix_space": false,
4
+ "added_tokens_decoder": {
5
+ "0": {
6
+ "content": "<|endoftext|>",
7
+ "lstrip": false,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false,
11
+ "special": true
12
+ },
13
+ "1": {
14
+ "content": "<fim_prefix>",
15
+ "lstrip": false,
16
+ "normalized": false,
17
+ "rstrip": false,
18
+ "single_word": false,
19
+ "special": true
20
+ },
21
+ "2": {
22
+ "content": "<fim_middle>",
23
+ "lstrip": false,
24
+ "normalized": false,
25
+ "rstrip": false,
26
+ "single_word": false,
27
+ "special": true
28
+ },
29
+ "3": {
30
+ "content": "<fim_suffix>",
31
+ "lstrip": false,
32
+ "normalized": false,
33
+ "rstrip": false,
34
+ "single_word": false,
35
+ "special": true
36
+ },
37
+ "4": {
38
+ "content": "<fim_pad>",
39
+ "lstrip": false,
40
+ "normalized": false,
41
+ "rstrip": false,
42
+ "single_word": false,
43
+ "special": true
44
+ },
45
+ "5": {
46
+ "content": "<repo_name>",
47
+ "lstrip": false,
48
+ "normalized": false,
49
+ "rstrip": false,
50
+ "single_word": false,
51
+ "special": true
52
+ },
53
+ "6": {
54
+ "content": "<file_sep>",
55
+ "lstrip": false,
56
+ "normalized": false,
57
+ "rstrip": false,
58
+ "single_word": false,
59
+ "special": true
60
+ },
61
+ "7": {
62
+ "content": "<issue_start>",
63
+ "lstrip": false,
64
+ "normalized": false,
65
+ "rstrip": false,
66
+ "single_word": false,
67
+ "special": true
68
+ },
69
+ "8": {
70
+ "content": "<issue_comment>",
71
+ "lstrip": false,
72
+ "normalized": false,
73
+ "rstrip": false,
74
+ "single_word": false,
75
+ "special": true
76
+ },
77
+ "9": {
78
+ "content": "<issue_closed>",
79
+ "lstrip": false,
80
+ "normalized": false,
81
+ "rstrip": false,
82
+ "single_word": false,
83
+ "special": true
84
+ },
85
+ "10": {
86
+ "content": "<jupyter_start>",
87
+ "lstrip": false,
88
+ "normalized": false,
89
+ "rstrip": false,
90
+ "single_word": false,
91
+ "special": true
92
+ },
93
+ "11": {
94
+ "content": "<jupyter_text>",
95
+ "lstrip": false,
96
+ "normalized": false,
97
+ "rstrip": false,
98
+ "single_word": false,
99
+ "special": true
100
+ },
101
+ "12": {
102
+ "content": "<jupyter_code>",
103
+ "lstrip": false,
104
+ "normalized": false,
105
+ "rstrip": false,
106
+ "single_word": false,
107
+ "special": true
108
+ },
109
+ "13": {
110
+ "content": "<jupyter_output>",
111
+ "lstrip": false,
112
+ "normalized": false,
113
+ "rstrip": false,
114
+ "single_word": false,
115
+ "special": true
116
+ },
117
+ "14": {
118
+ "content": "<jupyter_script>",
119
+ "lstrip": false,
120
+ "normalized": false,
121
+ "rstrip": false,
122
+ "single_word": false,
123
+ "special": true
124
+ },
125
+ "15": {
126
+ "content": "<empty_output>",
127
+ "lstrip": false,
128
+ "normalized": false,
129
+ "rstrip": false,
130
+ "single_word": false,
131
+ "special": true
132
+ },
133
+ "16": {
134
+ "content": "<code_to_intermediate>",
135
+ "lstrip": false,
136
+ "normalized": false,
137
+ "rstrip": false,
138
+ "single_word": false,
139
+ "special": true
140
+ },
141
+ "17": {
142
+ "content": "<intermediate_to_code>",
143
+ "lstrip": false,
144
+ "normalized": false,
145
+ "rstrip": false,
146
+ "single_word": false,
147
+ "special": true
148
+ },
149
+ "18": {
150
+ "content": "<pr>",
151
+ "lstrip": false,
152
+ "normalized": false,
153
+ "rstrip": false,
154
+ "single_word": false,
155
+ "special": true
156
+ },
157
+ "19": {
158
+ "content": "<pr_status>",
159
+ "lstrip": false,
160
+ "normalized": false,
161
+ "rstrip": false,
162
+ "single_word": false,
163
+ "special": true
164
+ },
165
+ "20": {
166
+ "content": "<pr_is_merged>",
167
+ "lstrip": false,
168
+ "normalized": false,
169
+ "rstrip": false,
170
+ "single_word": false,
171
+ "special": true
172
+ },
173
+ "21": {
174
+ "content": "<pr_base>",
175
+ "lstrip": false,
176
+ "normalized": false,
177
+ "rstrip": false,
178
+ "single_word": false,
179
+ "special": true
180
+ },
181
+ "22": {
182
+ "content": "<pr_file>",
183
+ "lstrip": false,
184
+ "normalized": false,
185
+ "rstrip": false,
186
+ "single_word": false,
187
+ "special": true
188
+ },
189
+ "23": {
190
+ "content": "<pr_base_code>",
191
+ "lstrip": false,
192
+ "normalized": false,
193
+ "rstrip": false,
194
+ "single_word": false,
195
+ "special": true
196
+ },
197
+ "24": {
198
+ "content": "<pr_diff>",
199
+ "lstrip": false,
200
+ "normalized": false,
201
+ "rstrip": false,
202
+ "single_word": false,
203
+ "special": true
204
+ },
205
+ "25": {
206
+ "content": "<pr_diff_hunk>",
207
+ "lstrip": false,
208
+ "normalized": false,
209
+ "rstrip": false,
210
+ "single_word": false,
211
+ "special": true
212
+ },
213
+ "26": {
214
+ "content": "<pr_comment>",
215
+ "lstrip": false,
216
+ "normalized": false,
217
+ "rstrip": false,
218
+ "single_word": false,
219
+ "special": true
220
+ },
221
+ "27": {
222
+ "content": "<pr_event_id>",
223
+ "lstrip": false,
224
+ "normalized": false,
225
+ "rstrip": false,
226
+ "single_word": false,
227
+ "special": true
228
+ },
229
+ "28": {
230
+ "content": "<pr_review>",
231
+ "lstrip": false,
232
+ "normalized": false,
233
+ "rstrip": false,
234
+ "single_word": false,
235
+ "special": true
236
+ },
237
+ "29": {
238
+ "content": "<pr_review_state>",
239
+ "lstrip": false,
240
+ "normalized": false,
241
+ "rstrip": false,
242
+ "single_word": false,
243
+ "special": true
244
+ },
245
+ "30": {
246
+ "content": "<pr_review_comment>",
247
+ "lstrip": false,
248
+ "normalized": false,
249
+ "rstrip": false,
250
+ "single_word": false,
251
+ "special": true
252
+ },
253
+ "31": {
254
+ "content": "<pr_in_reply_to_review_id>",
255
+ "lstrip": false,
256
+ "normalized": false,
257
+ "rstrip": false,
258
+ "single_word": false,
259
+ "special": true
260
+ },
261
+ "32": {
262
+ "content": "<pr_in_reply_to_comment_id>",
263
+ "lstrip": false,
264
+ "normalized": false,
265
+ "rstrip": false,
266
+ "single_word": false,
267
+ "special": true
268
+ },
269
+ "33": {
270
+ "content": "<pr_diff_hunk_comment_line>",
271
+ "lstrip": false,
272
+ "normalized": false,
273
+ "rstrip": false,
274
+ "single_word": false,
275
+ "special": true
276
+ },
277
+ "34": {
278
+ "content": "<NAME>",
279
+ "lstrip": false,
280
+ "normalized": false,
281
+ "rstrip": false,
282
+ "single_word": false,
283
+ "special": true
284
+ },
285
+ "35": {
286
+ "content": "<EMAIL>",
287
+ "lstrip": false,
288
+ "normalized": false,
289
+ "rstrip": false,
290
+ "single_word": false,
291
+ "special": true
292
+ },
293
+ "36": {
294
+ "content": "<KEY>",
295
+ "lstrip": false,
296
+ "normalized": false,
297
+ "rstrip": false,
298
+ "single_word": false,
299
+ "special": true
300
+ },
301
+ "37": {
302
+ "content": "<PASSWORD>",
303
+ "lstrip": false,
304
+ "normalized": false,
305
+ "rstrip": false,
306
+ "single_word": false,
307
+ "special": true
308
+ },
309
+ "49152": {
310
+ "content": "[PAD]",
311
+ "lstrip": false,
312
+ "normalized": false,
313
+ "rstrip": false,
314
+ "single_word": false,
315
+ "special": true
316
+ },
317
+ "49153": {
318
+ "content": "<svg-start>",
319
+ "lstrip": false,
320
+ "normalized": true,
321
+ "rstrip": false,
322
+ "single_word": false,
323
+ "special": false
324
+ },
325
+ "49154": {
326
+ "content": "<image-start>",
327
+ "lstrip": false,
328
+ "normalized": true,
329
+ "rstrip": false,
330
+ "single_word": false,
331
+ "special": false
332
+ },
333
+ "49155": {
334
+ "content": "<caption-start>",
335
+ "lstrip": false,
336
+ "normalized": true,
337
+ "rstrip": false,
338
+ "single_word": false,
339
+ "special": false
340
+ },
341
+ "49156": {
342
+ "content": "<svg-end>",
343
+ "lstrip": false,
344
+ "normalized": true,
345
+ "rstrip": false,
346
+ "single_word": false,
347
+ "special": false
348
+ }
349
+ },
350
+ "additional_special_tokens": [
351
+ "<|endoftext|>",
352
+ "<fim_prefix>",
353
+ "<fim_middle>",
354
+ "<fim_suffix>",
355
+ "<fim_pad>",
356
+ "<repo_name>",
357
+ "<file_sep>",
358
+ "<issue_start>",
359
+ "<issue_comment>",
360
+ "<issue_closed>",
361
+ "<jupyter_start>",
362
+ "<jupyter_text>",
363
+ "<jupyter_code>",
364
+ "<jupyter_output>",
365
+ "<jupyter_script>",
366
+ "<empty_output>",
367
+ "<code_to_intermediate>",
368
+ "<intermediate_to_code>",
369
+ "<pr>",
370
+ "<pr_status>",
371
+ "<pr_is_merged>",
372
+ "<pr_base>",
373
+ "<pr_file>",
374
+ "<pr_base_code>",
375
+ "<pr_diff>",
376
+ "<pr_diff_hunk>",
377
+ "<pr_comment>",
378
+ "<pr_event_id>",
379
+ "<pr_review>",
380
+ "<pr_review_state>",
381
+ "<pr_review_comment>",
382
+ "<pr_in_reply_to_review_id>",
383
+ "<pr_in_reply_to_comment_id>",
384
+ "<pr_diff_hunk_comment_line>",
385
+ "<NAME>",
386
+ "<EMAIL>",
387
+ "<KEY>",
388
+ "<PASSWORD>"
389
+ ],
390
+ "bos_token": "<|endoftext|>",
391
+ "clean_up_tokenization_spaces": true,
392
+ "eos_token": "<|endoftext|>",
393
+ "errors": "replace",
394
+ "model_max_length": 1000000000000000019884624838656,
395
+ "pad_token": "[PAD]",
396
+ "tokenizer_class": "GPT2Tokenizer",
397
+ "unk_token": "<|endoftext|>",
398
+ "vocab_size": 49152
399
+ }
vocab.json ADDED
The diff for this file is too large to render. See raw diff