Upload 41 files
Browse files- ckpts/README.md +268 -0
- ckpts/text_encoder_2/.cache/huggingface/.gitignore +1 -0
- ckpts/text_encoder_2/.cache/huggingface/download/.gitattributes.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/.gitattributes.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/README.md.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/README.md.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/config.json.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/config.json.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/flax_model.msgpack.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/flax_model.msgpack.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/merges.txt.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/merges.txt.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/model.safetensors.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/model.safetensors.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/preprocessor_config.json.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/preprocessor_config.json.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/pytorch_model.bin.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/pytorch_model.bin.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/special_tokens_map.json.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/special_tokens_map.json.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/tf_model.h5.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/tf_model.h5.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/tokenizer.json.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/tokenizer.json.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/tokenizer_config.json.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/tokenizer_config.json.metadata +3 -0
- ckpts/text_encoder_2/.cache/huggingface/download/vocab.json.lock +0 -0
- ckpts/text_encoder_2/.cache/huggingface/download/vocab.json.metadata +3 -0
- ckpts/text_encoder_2/.gitattributes +28 -0
- ckpts/text_encoder_2/README.md +145 -0
- ckpts/text_encoder_2/config.json +171 -0
- ckpts/text_encoder_2/flax_model.msgpack +3 -0
- ckpts/text_encoder_2/merges.txt +0 -0
- ckpts/text_encoder_2/model.safetensors +3 -0
- ckpts/text_encoder_2/preprocessor_config.json +19 -0
- ckpts/text_encoder_2/pytorch_model.bin +3 -0
- ckpts/text_encoder_2/special_tokens_map.json +1 -0
- ckpts/text_encoder_2/tf_model.h5 +3 -0
- ckpts/text_encoder_2/tokenizer.json +0 -0
- ckpts/text_encoder_2/tokenizer_config.json +34 -0
- ckpts/text_encoder_2/vocab.json +0 -0
ckpts/README.md
ADDED
@@ -0,0 +1,268 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
pipeline_tag: text-to-video
|
3 |
+
license: other
|
4 |
+
license_name: tencent-hunyuan-community
|
5 |
+
license_link: LICENSE
|
6 |
+
---
|
7 |
+
|
8 |
+
<!-- ## **HunyuanVideo** -->
|
9 |
+
|
10 |
+
<p align="center">
|
11 |
+
<img src="https://raw.githubusercontent.com/Tencent/HunyuanVideo/refs/heads/main/assets/logo.png" height=100>
|
12 |
+
</p>
|
13 |
+
|
14 |
+
# HunyuanVideo: A Systematic Framework For Large Video Generation Model Training
|
15 |
+
|
16 |
+
-----
|
17 |
+
|
18 |
+
This repo contains PyTorch model definitions, pre-trained weights and inference/sampling code for our paper exploring HunyuanVideo. You can find more visualizations on our [project page](https://aivideo.hunyuan.tencent.com).
|
19 |
+
|
20 |
+
> [**HunyuanVideo: A Systematic Framework For Large Video Generation Model Training**](https://arxiv.org/abs/2412.03603) <br>
|
21 |
+
|
22 |
+
## 🔥🔥🔥 News!!
|
23 |
+
* Dec 3, 2024: 🤗 We release the inference code and model weights of HunyuanVideo.
|
24 |
+
|
25 |
+
## 📑 Open-source Plan
|
26 |
+
|
27 |
+
- HunyuanVideo (Text-to-Video Model)
|
28 |
+
- [x] Inference
|
29 |
+
- [x] Checkpoints
|
30 |
+
- [ ] Penguin Video Benchmark
|
31 |
+
- [ ] Web Demo (Gradio)
|
32 |
+
- [ ] ComfyUI
|
33 |
+
- [ ] Diffusers
|
34 |
+
- HunyuanVideo (Image-to-Video Model)
|
35 |
+
- [ ] Inference
|
36 |
+
- [ ] Checkpoints
|
37 |
+
|
38 |
+
## Contents
|
39 |
+
- [HunyuanVideo: A Systematic Framework For Large Video Generation Model Training](#hunyuanvideo--a-systematic-framework-for-large-video-generation-model-training)
|
40 |
+
- [🔥🔥🔥 News!!](#-news!!)
|
41 |
+
- [📑 Open-source Plan](#-open-source-plan)
|
42 |
+
- [Contents](#contents)
|
43 |
+
- [**Abstract**](#abstract)
|
44 |
+
- [**HunyuanVideo Overall Architechture**](#-hunyuanvideo-overall-architechture)
|
45 |
+
- [🎉 **HunyuanVideo Key Features**](#-hunyuanvideo-key-features)
|
46 |
+
- [**Unified Image and Video Generative Architecture**](#unified-image-and-video-generative-architecture)
|
47 |
+
- [**MLLM Text Encoder**](#mllm-text-encoder)
|
48 |
+
- [**3D VAE**](#3d-vae)
|
49 |
+
- [**Prompt Rewrite**](#prompt-rewrite)
|
50 |
+
- [📈 Comparisons](#-comparisons)
|
51 |
+
- [📜 Requirements](#-requirements)
|
52 |
+
- [🛠️ Dependencies and Installation](#-dependencies-and-installation)
|
53 |
+
- [Installation Guide for Linux](#installation-guide-for-linux)
|
54 |
+
- [🧱 Download Pretrained Models](#-download-pretrained-models)
|
55 |
+
- [🔑 Inference](#-inference)
|
56 |
+
- [Using Command Line](#using-command-line)
|
57 |
+
- [More Configurations](#more-configurations)
|
58 |
+
- [🔗 BibTeX](#-bibtex)
|
59 |
+
- [Acknowledgements](#acknowledgements)
|
60 |
+
---
|
61 |
+
|
62 |
+
## **Abstract**
|
63 |
+
We present HunyuanVideo, a novel open-source video foundation model that exhibits performance in video generation that is comparable to, if not superior to, leading closed-source models. HunyuanVideo features a comprehensive framework that integrates several key contributions, including data curation, image-video joint model training, and an efficient infrastructure designed to facilitate large-scale model training and inference. Additionally, through an effective strategy for scaling model architecture and dataset, we successfully trained a video generative model with over 13 billion parameters, making it the largest among all open-source models.
|
64 |
+
|
65 |
+
We conducted extensive experiments and implemented a series of targeted designs to ensure high visual quality, motion diversity, text-video alignment, and generation stability. According to professional human evaluation results, HunyuanVideo outperforms previous state-of-the-art models, including Runway Gen-3, Luma 1.6, and 3 top performing Chinese video generative models. By releasing the code and weights of the foundation model and its applications, we aim to bridge the gap between closed-source and open-source video foundation models. This initiative will empower everyone in the community to experiment with their ideas, fostering a more dynamic and vibrant video generation ecosystem.
|
66 |
+
|
67 |
+
## **HunyuanVideo Overall Architechture**
|
68 |
+
|
69 |
+
HunyuanVideo is trained on a spatial-temporally
|
70 |
+
compressed latent space, which is compressed through Causal 3D VAE. Text prompts are encoded
|
71 |
+
using a large language model, and used as the condition. Gaussian noise and condition are taken as
|
72 |
+
input, our generate model generates an output latent, which is decoded to images or videos through
|
73 |
+
the 3D VAE decoder.
|
74 |
+
<p align="center">
|
75 |
+
<img src="https://raw.githubusercontent.com/Tencent/HunyuanVideo/refs/heads/main/assets/overall.png" height=300>
|
76 |
+
</p>
|
77 |
+
|
78 |
+
## 🎉 **HunyuanVideo Key Features**
|
79 |
+
### **Unified Image and Video Generative Architecture**
|
80 |
+
HunyuanVideo introduces the Transformer design and employs a Full Attention mechanism for unified image and video generation.
|
81 |
+
Specifically, we use a "Dual-stream to Single-stream" hybrid model design for video generation. In the dual-stream phase, video and text
|
82 |
+
tokens are processed independently through multiple Transformer blocks, enabling each modality to learn its own appropriate modulation mechanisms without interference. In the single-stream phase, we concatenate the video and text
|
83 |
+
tokens and feed them into subsequent Transformer blocks for effective multimodal information fusion.
|
84 |
+
This design captures complex interactions between visual and semantic information, enhancing
|
85 |
+
overall model performance.
|
86 |
+
<p align="center">
|
87 |
+
<img src="https://raw.githubusercontent.com/Tencent/HunyuanVideo/refs/heads/main/assets/backbone.png" height=350>
|
88 |
+
</p>
|
89 |
+
|
90 |
+
### **MLLM Text Encoder**
|
91 |
+
Some previous text-to-video model typically use pretrainednCLIP and T5-XXL as text encoders where CLIP uses Transformer Encoder and T5 uses a Encoder-Decoder structure. In constrast, we utilize a pretrained Multimodal Large Language Model (MLLM) with a Decoder-Only structure as our text encoder, which has following advantages: (i) Compared with T5, MLLM after visual instruction finetuning has better image-text alignment in the feature space, which alleviates the difficulty of instruction following in diffusion models; (ii)
|
92 |
+
Compared with CLIP, MLLM has been demonstrated superior ability in image detail description
|
93 |
+
and complex reasoning; (iii) MLLM can play as a zero-shot learner by following system instructions prepended to user prompts, helping text features pay more attention to key information. In addition, MLLM is based on causal attention while T5-XXL utilizes bidirectional attention that produces better text guidance for diffusion models. Therefore, we introduce an extra bidirectional token refiner for enhacing text features.
|
94 |
+
<p align="center">
|
95 |
+
<img src="https://raw.githubusercontent.com/Tencent/HunyuanVideo/refs/heads/main/assets/text_encoder.png" height=275>
|
96 |
+
</p>
|
97 |
+
|
98 |
+
### **3D VAE**
|
99 |
+
HunyuanVideo trains a 3D VAE with CausalConv3D to compress pixel-space videos and images into a compact latent space. We set the compression ratios of video length, space and channel to 4, 8 and 16 respectively. This can significantly reduce the number of tokens for the subsequent diffusion transformer model, allowing us to train videos at the original resolution and frame rate.
|
100 |
+
<p align="center">
|
101 |
+
<img src="https://raw.githubusercontent.com/Tencent/HunyuanVideo/refs/heads/main/assets/3dvae.png" height=150>
|
102 |
+
</p>
|
103 |
+
|
104 |
+
### **Prompt Rewrite**
|
105 |
+
To address the variability in linguistic style and length of user-provided prompts, we fine-tune the [Hunyuan-Large model](https://github.com/Tencent/Tencent-Hunyuan-Large) as our prompt rewrite model to adapt the original user prompt to model-preferred prompt.
|
106 |
+
|
107 |
+
We provide two rewrite modes: Normal mode and Master mode, which can be called using different prompts. The Normal mode is designed to enhance the video generation model's comprehension of user intent, facilitating a more accurate interpretation of the instructions provided. The Master mode enhances the description of aspects such as composition, lighting, and camera movement, which leans towards generating videos with a higher visual quality. However, this emphasis may occasionally result in the loss of some semantic details.
|
108 |
+
|
109 |
+
The Prompt Rewrite Model can be directly deployed and inferred using the [Hunyuan-Large original code](https://github.com/Tencent/Tencent-Hunyuan-Large). We release the weights of the Prompt Rewrite Model [here](https://huggingface.co/Tencent/HunyuanVideo-PromptRewrite).
|
110 |
+
|
111 |
+
## 📈 Comparisons
|
112 |
+
|
113 |
+
To evaluate the performance of HunyuanVideo, we selected five strong baselines from closed-source video generation models. In total, we utilized 1,533 text prompts, generating an equal number of video samples with HunyuanVideo in a single run. For a fair comparison, we conducted inference only once, avoiding any cherry-picking of results. When comparing with the baseline methods, we maintained the default settings for all selected models, ensuring consistent video resolution. Videos were assessed based on three criteria: Text Alignment, Motion Quality and Visual Quality. More than 60 professional evaluators performed the evaluation. Notably, HunyuanVideo demonstrated the best overall performance, particularly excelling in motion quality.
|
114 |
+
|
115 |
+
<p align="center">
|
116 |
+
<table>
|
117 |
+
<thead>
|
118 |
+
<tr>
|
119 |
+
<th rowspan="2">Model</th> <th rowspan="2">Open Source</th> <th>Duration</th> <th>Text Alignment</th> <th>Motion Quality</th> <th rowspan="2">Visual Quality</th> <th rowspan="2">Overall</th> <th rowspan="2">Ranking</th>
|
120 |
+
</tr>
|
121 |
+
</thead>
|
122 |
+
<tbody>
|
123 |
+
<tr>
|
124 |
+
<td>HunyuanVideo (Ours)</td> <td> ✔ </td> <td>5s</td> <td>61.8%</td> <td>66.5%</td> <td>95.7%</td> <td>41.3%</td> <td>1</td>
|
125 |
+
</tr>
|
126 |
+
<tr>
|
127 |
+
<td>CNTopA (API)</td> <td> ✘ </td> <td>5s</td> <td>62.6%</td> <td>61.7%</td> <td>95.6%</td> <td>37.7%</td> <td>2</td>
|
128 |
+
</tr>
|
129 |
+
<tr>
|
130 |
+
<td>CNTopB (Web)</td> <td> ✘</td> <td>5s</td> <td>60.1%</td> <td>62.9%</td> <td>97.7%</td> <td>37.5%</td> <td>3</td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td>GEN-3 alpha (Web)</td> <td>✘</td> <td>6s</td> <td>47.7%</td> <td>54.7%</td> <td>97.5%</td> <td>27.4%</td> <td>4</td>
|
134 |
+
</tr>
|
135 |
+
<tr>
|
136 |
+
<td>Luma1.6 (API)</td><td>✘</td> <td>5s</td> <td>57.6%</td> <td>44.2%</td> <td>94.1%</td> <td>24.8%</td> <td>6</td>
|
137 |
+
</tr>
|
138 |
+
<tr>
|
139 |
+
<td>CNTopC (Web)</td> <td>✘</td> <td>5s</td> <td>48.4%</td> <td>47.2%</td> <td>96.3%</td> <td>24.6%</td> <td>5</td>
|
140 |
+
</tr>
|
141 |
+
</tbody>
|
142 |
+
</table>
|
143 |
+
</p>
|
144 |
+
|
145 |
+
## 📜 Requirements
|
146 |
+
|
147 |
+
The following table shows the requirements for running HunyuanVideo model (batch size = 1) to generate videos:
|
148 |
+
|
149 |
+
| Model | Setting<br/>(height/width/frame) | GPU Peak Memory |
|
150 |
+
|:------------:|:--------------------------------:|:----------------:|
|
151 |
+
| HunyuanVideo | 720px1280px129f | 60GB |
|
152 |
+
| HunyuanVideo | 544px960px129f | 45GB |
|
153 |
+
|
154 |
+
* An NVIDIA GPU with CUDA support is required.
|
155 |
+
* The model is tested on a single 80G GPU.
|
156 |
+
* **Minimum**: The minimum GPU memory required is 60GB for 720px1280px129f and 45G for 544px960px129f.
|
157 |
+
* **Recommended**: We recommend using a GPU with 80GB of memory for better generation quality.
|
158 |
+
* Tested operating system: Linux
|
159 |
+
|
160 |
+
## 🛠️ Dependencies and Installation
|
161 |
+
|
162 |
+
Begin by cloning the repository:
|
163 |
+
```shell
|
164 |
+
git clone https://github.com/tencent/HunyuanVideo
|
165 |
+
cd HunyuanVideo
|
166 |
+
```
|
167 |
+
|
168 |
+
### Installation Guide for Linux
|
169 |
+
|
170 |
+
We provide an `environment.yml` file for setting up a Conda environment.
|
171 |
+
Conda's installation instructions are available [here](https://docs.anaconda.com/free/miniconda/index.html).
|
172 |
+
|
173 |
+
We recommend CUDA versions 11.8 and 12.0+.
|
174 |
+
|
175 |
+
```shell
|
176 |
+
# 1. Prepare conda environment
|
177 |
+
conda env create -f environment.yml
|
178 |
+
|
179 |
+
# 2. Activate the environment
|
180 |
+
conda activate HunyuanVideo
|
181 |
+
|
182 |
+
# 3. Install pip dependencies
|
183 |
+
python -m pip install -r requirements.txt
|
184 |
+
|
185 |
+
# 4. Install flash attention v2 for acceleration (requires CUDA 11.8 or above)
|
186 |
+
python -m pip install git+https://github.com/Dao-AILab/[email protected]
|
187 |
+
```
|
188 |
+
|
189 |
+
Additionally, HunyuanVideo also provides a pre-built Docker image:
|
190 |
+
[docker_hunyuanvideo](https://hub.docker.com/repository/docker/hunyuanvideo/hunyuanvideo/general).
|
191 |
+
|
192 |
+
```shell
|
193 |
+
# 1. Use the following link to download the docker image tar file (For CUDA 12).
|
194 |
+
wget https://aivideo.hunyuan.tencent.com/download/HunyuanVideo/hunyuan_video_cu12.tar
|
195 |
+
|
196 |
+
# 2. Import the docker tar file and show the image meta information (For CUDA 12).
|
197 |
+
docker load -i hunyuan_video.tar
|
198 |
+
|
199 |
+
docker image ls
|
200 |
+
|
201 |
+
# 3. Run the container based on the image
|
202 |
+
docker run -itd --gpus all --init --net=host --uts=host --ipc=host --name hunyuanvideo --security-opt=seccomp=unconfined --ulimit=stack=67108864 --ulimit=memlock=-1 --privileged docker_image_tag
|
203 |
+
```
|
204 |
+
|
205 |
+
|
206 |
+
## 🧱 Download Pretrained Models
|
207 |
+
|
208 |
+
The details of download pretrained models are shown [here](https://github.com/Tencent/HunyuanVideo/blob/main/ckpts/README.md).
|
209 |
+
|
210 |
+
## 🔑 Inference
|
211 |
+
We list the height/width/frame settings we support in the following table.
|
212 |
+
|
213 |
+
| Resolution | h/w=9:16 | h/w=16:9 | h/w=4:3 | h/w=3:4 | h/w=1:1 |
|
214 |
+
|:---------------------:|:----------------------------:|:---------------:|:---------------:|:---------------:|:---------------:|
|
215 |
+
| 540p | 544px960px129f | 960px544px129f | 624px832px129f | 832px624px129f | 720px720px129f |
|
216 |
+
| 720p (recommended) | 720px1280px129f | 1280px720px129f | 1104px832px129f | 832px1104px129f | 960px960px129f |
|
217 |
+
|
218 |
+
### Using Command Line
|
219 |
+
|
220 |
+
```bash
|
221 |
+
cd HunyuanVideo
|
222 |
+
|
223 |
+
python3 sample_video.py \
|
224 |
+
--video-size 720 1280 \
|
225 |
+
--video-length 129 \
|
226 |
+
--infer-steps 30 \
|
227 |
+
--prompt "a cat is running, realistic." \
|
228 |
+
--flow-reverse \
|
229 |
+
--seed 0 \
|
230 |
+
--use-cpu-offload \
|
231 |
+
--save-path ./results
|
232 |
+
```
|
233 |
+
|
234 |
+
### More Configurations
|
235 |
+
|
236 |
+
We list some more useful configurations for easy usage:
|
237 |
+
|
238 |
+
| Argument | Default | Description |
|
239 |
+
|:----------------------:|:---------:|:-----------------------------------------:|
|
240 |
+
| `--prompt` | None | The text prompt for video generation |
|
241 |
+
| `--video-size` | 720 1280 | The size of the generated video |
|
242 |
+
| `--video-length` | 129 | The length of the generated video |
|
243 |
+
| `--infer-steps` | 30 | The number of steps for sampling |
|
244 |
+
| `--embedded-cfg-scale` | 6.0 | Embeded Classifier free guidance scale |
|
245 |
+
| `--flow-shift` | 9.0 | Shift factor for flow matching schedulers |
|
246 |
+
| `--flow-reverse` | False | If reverse, learning/sampling from t=1 -> t=0 |
|
247 |
+
| `--neg-prompt` | None | The negative prompt for video generation |
|
248 |
+
| `--seed` | 0 | The random seed for generating video |
|
249 |
+
| `--use-cpu-offload` | False | Use CPU offload for the model load to save more memory, necessary for high-res video generation |
|
250 |
+
| `--save-path` | ./results | Path to save the generated video |
|
251 |
+
|
252 |
+
|
253 |
+
## 🔗 BibTeX
|
254 |
+
If you find [HunyuanVideo](https://arxiv.org/abs/2412.03603) useful for your research and applications, please cite using this BibTeX:
|
255 |
+
|
256 |
+
```BibTeX
|
257 |
+
@misc{kong2024hunyuanvideo,
|
258 |
+
title={HunyuanVideo: A Systematic Framework For Large Video Generative Models},
|
259 |
+
author={Weijie Kong, Qi Tian, Zijian Zhang, Rox Min, Zuozhuo Dai, Jin Zhou, Jiangfeng Xiong, Xin Li, Bo Wu, Jianwei Zhang, Kathrina Wu, Qin Lin, Aladdin Wang, Andong Wang, Changlin Li, Duojun Huang, Fang Yang, Hao Tan, Hongmei Wang, Jacob Song, Jiawang Bai, Jianbing Wu, Jinbao Xue, Joey Wang, Junkun Yuan, Kai Wang, Mengyang Liu, Pengyu Li, Shuai Li, Weiyan Wang, Wenqing Yu, Xinchi Deng, Yang Li, Yanxin Long, Yi Chen, Yutao Cui, Yuanbo Peng, Zhentao Yu, Zhiyu He, Zhiyong Xu, Zixiang Zhou, Yangyu Tao, Qinglin Lu, Songtao Liu, Dax Zhou, Hongfa Wang, Yong Yang, Di Wang, Yuhong Liu, and Jie Jiang, along with Caesar Zhong},
|
260 |
+
year={2024},
|
261 |
+
archivePrefix={arXiv preprint arXiv:2412.03603},
|
262 |
+
primaryClass={cs.CV}
|
263 |
+
}
|
264 |
+
```
|
265 |
+
|
266 |
+
## Acknowledgements
|
267 |
+
We would like to thank the contributors to the [SD3](https://huggingface.co/stabilityai/stable-diffusion-3-medium), [FLUX](https://github.com/black-forest-labs/flux), [Llama](https://github.com/meta-llama/llama), [LLaVA](https://github.com/haotian-liu/LLaVA), [Xtuner](https://github.com/InternLM/xtuner), [diffusers](https://github.com/huggingface/diffusers) and [HuggingFace](https://huggingface.co) repositories, for their open research and exploration.
|
268 |
+
Additionally, we also thank the Tencent Hunyuan Multimodal team for their help with the text encoder.
|
ckpts/text_encoder_2/.cache/huggingface/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*
|
ckpts/text_encoder_2/.cache/huggingface/download/.gitattributes.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/.gitattributes.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
2bf99854609538f90af03c921c41a0cbde670b2f
|
3 |
+
1733648060.452038
|
ckpts/text_encoder_2/.cache/huggingface/download/README.md.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/README.md.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
4ccd659d4a0f649d10686540ea4a2b20ff276eda
|
3 |
+
1733648060.3197114
|
ckpts/text_encoder_2/.cache/huggingface/download/config.json.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/config.json.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
2c19f6666e0e163c7954df66cb901353fcad088e
|
3 |
+
1733648059.7685747
|
ckpts/text_encoder_2/.cache/huggingface/download/flax_model.msgpack.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/flax_model.msgpack.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
156f677ed4495acd1ec7197249c091b85c240267c82f2f7f2e4eae4177931fed
|
3 |
+
1733648082.3625822
|
ckpts/text_encoder_2/.cache/huggingface/download/merges.txt.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/merges.txt.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
76e821f1b6f0a9709293c3b6b51ed90980b3166b
|
3 |
+
1733648060.5627046
|
ckpts/text_encoder_2/.cache/huggingface/download/model.safetensors.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/model.safetensors.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
a2bf730a0c7debf160f7a6b50b3aaf3703e7e88ac73de7a314903141db026dcb
|
3 |
+
1733648082.840822
|
ckpts/text_encoder_2/.cache/huggingface/download/preprocessor_config.json.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/preprocessor_config.json.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
5a12a1eb250987a4eee0e3e7d7338c4b22724be1
|
3 |
+
1733648059.9271517
|
ckpts/text_encoder_2/.cache/huggingface/download/pytorch_model.bin.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/pytorch_model.bin.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
f1a17cdbe0f36fec524f5cafb1c261ea3bbbc13e346e0f74fc9eb0460dedd0d3
|
3 |
+
1733648083.8389857
|
ckpts/text_encoder_2/.cache/huggingface/download/special_tokens_map.json.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/special_tokens_map.json.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
9bfb42aa97dcd61e89f279ccaee988bccb4fabae
|
3 |
+
1733648061.4190924
|
ckpts/text_encoder_2/.cache/huggingface/download/tf_model.h5.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/tf_model.h5.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
7f154e925c18270d662d28f6261523c2ff6e80f1f05292cb034db41d5951c7a4
|
3 |
+
1733648086.4292495
|
ckpts/text_encoder_2/.cache/huggingface/download/tokenizer.json.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/tokenizer.json.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
580c79c6862f31d1f9bd08dd1a415ba0d0502cd9
|
3 |
+
1733648062.3252542
|
ckpts/text_encoder_2/.cache/huggingface/download/tokenizer_config.json.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/tokenizer_config.json.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
702bb12920b291cade3706cf215c1604d2255d93
|
3 |
+
1733648061.8902612
|
ckpts/text_encoder_2/.cache/huggingface/download/vocab.json.lock
ADDED
File without changes
|
ckpts/text_encoder_2/.cache/huggingface/download/vocab.json.metadata
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
32bd64288804d66eefd0ccbe215aa642df71cc41
|
2 |
+
4297ea6a8d2bae1fea8f48b45e257814dcb11f69
|
3 |
+
1733648062.5392745
|
ckpts/text_encoder_2/.gitattributes
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
*.bin.* filter=lfs diff=lfs merge=lfs -text
|
5 |
+
*.bz2 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 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
12 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
13 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
14 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
15 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
16 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
17 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
18 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
19 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
20 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
21 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
22 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
23 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
24 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
25 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
+
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
model.safetensors filter=lfs diff=lfs merge=lfs -text
|
ckpts/text_encoder_2/README.md
ADDED
@@ -0,0 +1,145 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
tags:
|
3 |
+
- vision
|
4 |
+
widget:
|
5 |
+
- src: https://huggingface.co/datasets/mishig/sample_images/resolve/main/cat-dog-music.png
|
6 |
+
candidate_labels: playing music, playing sports
|
7 |
+
example_title: Cat & Dog
|
8 |
+
---
|
9 |
+
|
10 |
+
# Model Card: CLIP
|
11 |
+
|
12 |
+
Disclaimer: The model card is taken and modified from the official CLIP repository, it can be found [here](https://github.com/openai/CLIP/blob/main/model-card.md).
|
13 |
+
|
14 |
+
## Model Details
|
15 |
+
|
16 |
+
The CLIP model was developed by researchers at OpenAI to learn about what contributes to robustness in computer vision tasks. The model was also developed to test the ability of models to generalize to arbitrary image classification tasks in a zero-shot manner. It was not developed for general model deployment - to deploy models like CLIP, researchers will first need to carefully study their capabilities in relation to the specific context they’re being deployed within.
|
17 |
+
|
18 |
+
### Model Date
|
19 |
+
|
20 |
+
January 2021
|
21 |
+
|
22 |
+
### Model Type
|
23 |
+
|
24 |
+
The base model uses a ViT-L/14 Transformer architecture as an image encoder and uses a masked self-attention Transformer as a text encoder. These encoders are trained to maximize the similarity of (image, text) pairs via a contrastive loss.
|
25 |
+
|
26 |
+
The original implementation had two variants: one using a ResNet image encoder and the other using a Vision Transformer. This repository has the variant with the Vision Transformer.
|
27 |
+
|
28 |
+
|
29 |
+
### Documents
|
30 |
+
|
31 |
+
- [Blog Post](https://openai.com/blog/clip/)
|
32 |
+
- [CLIP Paper](https://arxiv.org/abs/2103.00020)
|
33 |
+
|
34 |
+
|
35 |
+
### Use with Transformers
|
36 |
+
|
37 |
+
```python
|
38 |
+
from PIL import Image
|
39 |
+
import requests
|
40 |
+
|
41 |
+
from transformers import CLIPProcessor, CLIPModel
|
42 |
+
|
43 |
+
model = CLIPModel.from_pretrained("openai/clip-vit-large-patch14")
|
44 |
+
processor = CLIPProcessor.from_pretrained("openai/clip-vit-large-patch14")
|
45 |
+
|
46 |
+
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
|
47 |
+
image = Image.open(requests.get(url, stream=True).raw)
|
48 |
+
|
49 |
+
inputs = processor(text=["a photo of a cat", "a photo of a dog"], images=image, return_tensors="pt", padding=True)
|
50 |
+
|
51 |
+
outputs = model(**inputs)
|
52 |
+
logits_per_image = outputs.logits_per_image # this is the image-text similarity score
|
53 |
+
probs = logits_per_image.softmax(dim=1) # we can take the softmax to get the label probabilities
|
54 |
+
```
|
55 |
+
|
56 |
+
|
57 |
+
## Model Use
|
58 |
+
|
59 |
+
### Intended Use
|
60 |
+
|
61 |
+
The model is intended as a research output for research communities. We hope that this model will enable researchers to better understand and explore zero-shot, arbitrary image classification. We also hope it can be used for interdisciplinary studies of the potential impact of such models - the CLIP paper includes a discussion of potential downstream impacts to provide an example for this sort of analysis.
|
62 |
+
|
63 |
+
#### Primary intended uses
|
64 |
+
|
65 |
+
The primary intended users of these models are AI researchers.
|
66 |
+
|
67 |
+
We primarily imagine the model will be used by researchers to better understand robustness, generalization, and other capabilities, biases, and constraints of computer vision models.
|
68 |
+
|
69 |
+
### Out-of-Scope Use Cases
|
70 |
+
|
71 |
+
**Any** deployed use case of the model - whether commercial or not - is currently out of scope. Non-deployed use cases such as image search in a constrained environment, are also not recommended unless there is thorough in-domain testing of the model with a specific, fixed class taxonomy. This is because our safety assessment demonstrated a high need for task specific testing especially given the variability of CLIP’s performance with different class taxonomies. This makes untested and unconstrained deployment of the model in any use case currently potentially harmful.
|
72 |
+
|
73 |
+
Certain use cases which would fall under the domain of surveillance and facial recognition are always out-of-scope regardless of performance of the model. This is because the use of artificial intelligence for tasks such as these can be premature currently given the lack of testing norms and checks to ensure its fair use.
|
74 |
+
|
75 |
+
Since the model has not been purposefully trained in or evaluated on any languages other than English, its use should be limited to English language use cases.
|
76 |
+
|
77 |
+
|
78 |
+
|
79 |
+
## Data
|
80 |
+
|
81 |
+
The model was trained on publicly available image-caption data. This was done through a combination of crawling a handful of websites and using commonly-used pre-existing image datasets such as [YFCC100M](http://projects.dfki.uni-kl.de/yfcc100m/). A large portion of the data comes from our crawling of the internet. This means that the data is more representative of people and societies most connected to the internet which tend to skew towards more developed nations, and younger, male users.
|
82 |
+
|
83 |
+
### Data Mission Statement
|
84 |
+
|
85 |
+
Our goal with building this dataset was to test out robustness and generalizability in computer vision tasks. As a result, the focus was on gathering large quantities of data from different publicly-available internet data sources. The data was gathered in a mostly non-interventionist manner. However, we only crawled websites that had policies against excessively violent and adult images and allowed us to filter out such content. We do not intend for this dataset to be used as the basis for any commercial or deployed model and will not be releasing the dataset.
|
86 |
+
|
87 |
+
|
88 |
+
|
89 |
+
## Performance and Limitations
|
90 |
+
|
91 |
+
### Performance
|
92 |
+
|
93 |
+
We have evaluated the performance of CLIP on a wide range of benchmarks across a variety of computer vision datasets such as OCR to texture recognition to fine-grained classification. The paper describes model performance on the following datasets:
|
94 |
+
|
95 |
+
- Food101
|
96 |
+
- CIFAR10
|
97 |
+
- CIFAR100
|
98 |
+
- Birdsnap
|
99 |
+
- SUN397
|
100 |
+
- Stanford Cars
|
101 |
+
- FGVC Aircraft
|
102 |
+
- VOC2007
|
103 |
+
- DTD
|
104 |
+
- Oxford-IIIT Pet dataset
|
105 |
+
- Caltech101
|
106 |
+
- Flowers102
|
107 |
+
- MNIST
|
108 |
+
- SVHN
|
109 |
+
- IIIT5K
|
110 |
+
- Hateful Memes
|
111 |
+
- SST-2
|
112 |
+
- UCF101
|
113 |
+
- Kinetics700
|
114 |
+
- Country211
|
115 |
+
- CLEVR Counting
|
116 |
+
- KITTI Distance
|
117 |
+
- STL-10
|
118 |
+
- RareAct
|
119 |
+
- Flickr30
|
120 |
+
- MSCOCO
|
121 |
+
- ImageNet
|
122 |
+
- ImageNet-A
|
123 |
+
- ImageNet-R
|
124 |
+
- ImageNet Sketch
|
125 |
+
- ObjectNet (ImageNet Overlap)
|
126 |
+
- Youtube-BB
|
127 |
+
- ImageNet-Vid
|
128 |
+
|
129 |
+
## Limitations
|
130 |
+
|
131 |
+
CLIP and our analysis of it have a number of limitations. CLIP currently struggles with respect to certain tasks such as fine grained classification and counting objects. CLIP also poses issues with regards to fairness and bias which we discuss in the paper and briefly in the next section. Additionally, our approach to testing CLIP also has an important limitation- in many cases we have used linear probes to evaluate the performance of CLIP and there is evidence suggesting that linear probes can underestimate model performance.
|
132 |
+
|
133 |
+
### Bias and Fairness
|
134 |
+
|
135 |
+
We find that the performance of CLIP - and the specific biases it exhibits - can depend significantly on class design and the choices one makes for categories to include and exclude. We tested the risk of certain kinds of denigration with CLIP by classifying images of people from [Fairface](https://arxiv.org/abs/1908.04913) into crime-related and non-human animal categories. We found significant disparities with respect to race and gender. Additionally, we found that these disparities could shift based on how the classes were constructed. (Details captured in the Broader Impacts Section in the paper).
|
136 |
+
|
137 |
+
We also tested the performance of CLIP on gender, race and age classification using the Fairface dataset (We default to using race categories as they are constructed in the Fairface dataset.) in order to assess quality of performance across different demographics. We found accuracy >96% across all races for gender classification with ‘Middle Eastern’ having the highest accuracy (98.4%) and ‘White’ having the lowest (96.5%). Additionally, CLIP averaged ~93% for racial classification and ~63% for age classification. Our use of evaluations to test for gender, race and age classification as well as denigration harms is simply to evaluate performance of the model across people and surface potential risks and not to demonstrate an endorsement/enthusiasm for such tasks.
|
138 |
+
|
139 |
+
|
140 |
+
|
141 |
+
## Feedback
|
142 |
+
|
143 |
+
### Where to send questions or comments about the model
|
144 |
+
|
145 |
+
Please use [this Google Form](https://forms.gle/Uv7afRH5dvY34ZEs9)
|
ckpts/text_encoder_2/config.json
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "clip-vit-large-patch14/",
|
3 |
+
"architectures": [
|
4 |
+
"CLIPModel"
|
5 |
+
],
|
6 |
+
"initializer_factor": 1.0,
|
7 |
+
"logit_scale_init_value": 2.6592,
|
8 |
+
"model_type": "clip",
|
9 |
+
"projection_dim": 768,
|
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 |
+
"bos_token_id": 0,
|
17 |
+
"chunk_size_feed_forward": 0,
|
18 |
+
"cross_attention_hidden_size": null,
|
19 |
+
"decoder_start_token_id": null,
|
20 |
+
"diversity_penalty": 0.0,
|
21 |
+
"do_sample": false,
|
22 |
+
"dropout": 0.0,
|
23 |
+
"early_stopping": false,
|
24 |
+
"encoder_no_repeat_ngram_size": 0,
|
25 |
+
"eos_token_id": 2,
|
26 |
+
"finetuning_task": null,
|
27 |
+
"forced_bos_token_id": null,
|
28 |
+
"forced_eos_token_id": null,
|
29 |
+
"hidden_act": "quick_gelu",
|
30 |
+
"hidden_size": 768,
|
31 |
+
"id2label": {
|
32 |
+
"0": "LABEL_0",
|
33 |
+
"1": "LABEL_1"
|
34 |
+
},
|
35 |
+
"initializer_factor": 1.0,
|
36 |
+
"initializer_range": 0.02,
|
37 |
+
"intermediate_size": 3072,
|
38 |
+
"is_decoder": false,
|
39 |
+
"is_encoder_decoder": false,
|
40 |
+
"label2id": {
|
41 |
+
"LABEL_0": 0,
|
42 |
+
"LABEL_1": 1
|
43 |
+
},
|
44 |
+
"layer_norm_eps": 1e-05,
|
45 |
+
"length_penalty": 1.0,
|
46 |
+
"max_length": 20,
|
47 |
+
"max_position_embeddings": 77,
|
48 |
+
"min_length": 0,
|
49 |
+
"model_type": "clip_text_model",
|
50 |
+
"no_repeat_ngram_size": 0,
|
51 |
+
"num_attention_heads": 12,
|
52 |
+
"num_beam_groups": 1,
|
53 |
+
"num_beams": 1,
|
54 |
+
"num_hidden_layers": 12,
|
55 |
+
"num_return_sequences": 1,
|
56 |
+
"output_attentions": false,
|
57 |
+
"output_hidden_states": false,
|
58 |
+
"output_scores": false,
|
59 |
+
"pad_token_id": 1,
|
60 |
+
"prefix": null,
|
61 |
+
"problem_type": null,
|
62 |
+
"projection_dim" : 768,
|
63 |
+
"pruned_heads": {},
|
64 |
+
"remove_invalid_values": false,
|
65 |
+
"repetition_penalty": 1.0,
|
66 |
+
"return_dict": true,
|
67 |
+
"return_dict_in_generate": false,
|
68 |
+
"sep_token_id": null,
|
69 |
+
"task_specific_params": null,
|
70 |
+
"temperature": 1.0,
|
71 |
+
"tie_encoder_decoder": false,
|
72 |
+
"tie_word_embeddings": true,
|
73 |
+
"tokenizer_class": null,
|
74 |
+
"top_k": 50,
|
75 |
+
"top_p": 1.0,
|
76 |
+
"torch_dtype": null,
|
77 |
+
"torchscript": false,
|
78 |
+
"transformers_version": "4.16.0.dev0",
|
79 |
+
"use_bfloat16": false,
|
80 |
+
"vocab_size": 49408
|
81 |
+
},
|
82 |
+
"text_config_dict": {
|
83 |
+
"hidden_size": 768,
|
84 |
+
"intermediate_size": 3072,
|
85 |
+
"num_attention_heads": 12,
|
86 |
+
"num_hidden_layers": 12,
|
87 |
+
"projection_dim": 768
|
88 |
+
},
|
89 |
+
"torch_dtype": "float32",
|
90 |
+
"transformers_version": null,
|
91 |
+
"vision_config": {
|
92 |
+
"_name_or_path": "",
|
93 |
+
"add_cross_attention": false,
|
94 |
+
"architectures": null,
|
95 |
+
"attention_dropout": 0.0,
|
96 |
+
"bad_words_ids": null,
|
97 |
+
"bos_token_id": null,
|
98 |
+
"chunk_size_feed_forward": 0,
|
99 |
+
"cross_attention_hidden_size": null,
|
100 |
+
"decoder_start_token_id": null,
|
101 |
+
"diversity_penalty": 0.0,
|
102 |
+
"do_sample": false,
|
103 |
+
"dropout": 0.0,
|
104 |
+
"early_stopping": false,
|
105 |
+
"encoder_no_repeat_ngram_size": 0,
|
106 |
+
"eos_token_id": null,
|
107 |
+
"finetuning_task": null,
|
108 |
+
"forced_bos_token_id": null,
|
109 |
+
"forced_eos_token_id": null,
|
110 |
+
"hidden_act": "quick_gelu",
|
111 |
+
"hidden_size": 1024,
|
112 |
+
"id2label": {
|
113 |
+
"0": "LABEL_0",
|
114 |
+
"1": "LABEL_1"
|
115 |
+
},
|
116 |
+
"image_size": 224,
|
117 |
+
"initializer_factor": 1.0,
|
118 |
+
"initializer_range": 0.02,
|
119 |
+
"intermediate_size": 4096,
|
120 |
+
"is_decoder": false,
|
121 |
+
"is_encoder_decoder": false,
|
122 |
+
"label2id": {
|
123 |
+
"LABEL_0": 0,
|
124 |
+
"LABEL_1": 1
|
125 |
+
},
|
126 |
+
"layer_norm_eps": 1e-05,
|
127 |
+
"length_penalty": 1.0,
|
128 |
+
"max_length": 20,
|
129 |
+
"min_length": 0,
|
130 |
+
"model_type": "clip_vision_model",
|
131 |
+
"no_repeat_ngram_size": 0,
|
132 |
+
"num_attention_heads": 16,
|
133 |
+
"num_beam_groups": 1,
|
134 |
+
"num_beams": 1,
|
135 |
+
"num_hidden_layers": 24,
|
136 |
+
"num_return_sequences": 1,
|
137 |
+
"output_attentions": false,
|
138 |
+
"output_hidden_states": false,
|
139 |
+
"output_scores": false,
|
140 |
+
"pad_token_id": null,
|
141 |
+
"patch_size": 14,
|
142 |
+
"prefix": null,
|
143 |
+
"problem_type": null,
|
144 |
+
"projection_dim" : 768,
|
145 |
+
"pruned_heads": {},
|
146 |
+
"remove_invalid_values": false,
|
147 |
+
"repetition_penalty": 1.0,
|
148 |
+
"return_dict": true,
|
149 |
+
"return_dict_in_generate": false,
|
150 |
+
"sep_token_id": null,
|
151 |
+
"task_specific_params": null,
|
152 |
+
"temperature": 1.0,
|
153 |
+
"tie_encoder_decoder": false,
|
154 |
+
"tie_word_embeddings": true,
|
155 |
+
"tokenizer_class": null,
|
156 |
+
"top_k": 50,
|
157 |
+
"top_p": 1.0,
|
158 |
+
"torch_dtype": null,
|
159 |
+
"torchscript": false,
|
160 |
+
"transformers_version": "4.16.0.dev0",
|
161 |
+
"use_bfloat16": false
|
162 |
+
},
|
163 |
+
"vision_config_dict": {
|
164 |
+
"hidden_size": 1024,
|
165 |
+
"intermediate_size": 4096,
|
166 |
+
"num_attention_heads": 16,
|
167 |
+
"num_hidden_layers": 24,
|
168 |
+
"patch_size": 14,
|
169 |
+
"projection_dim": 768
|
170 |
+
}
|
171 |
+
}
|
ckpts/text_encoder_2/flax_model.msgpack
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:156f677ed4495acd1ec7197249c091b85c240267c82f2f7f2e4eae4177931fed
|
3 |
+
size 1710486359
|
ckpts/text_encoder_2/merges.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|
ckpts/text_encoder_2/model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:a2bf730a0c7debf160f7a6b50b3aaf3703e7e88ac73de7a314903141db026dcb
|
3 |
+
size 1710540580
|
ckpts/text_encoder_2/preprocessor_config.json
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"crop_size": 224,
|
3 |
+
"do_center_crop": true,
|
4 |
+
"do_normalize": true,
|
5 |
+
"do_resize": true,
|
6 |
+
"feature_extractor_type": "CLIPFeatureExtractor",
|
7 |
+
"image_mean": [
|
8 |
+
0.48145466,
|
9 |
+
0.4578275,
|
10 |
+
0.40821073
|
11 |
+
],
|
12 |
+
"image_std": [
|
13 |
+
0.26862954,
|
14 |
+
0.26130258,
|
15 |
+
0.27577711
|
16 |
+
],
|
17 |
+
"resample": 3,
|
18 |
+
"size": 224
|
19 |
+
}
|
ckpts/text_encoder_2/pytorch_model.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f1a17cdbe0f36fec524f5cafb1c261ea3bbbc13e346e0f74fc9eb0460dedd0d3
|
3 |
+
size 1710671599
|
ckpts/text_encoder_2/special_tokens_map.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
{"bos_token": {"content": "<|startoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "eos_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "unk_token": {"content": "<|endoftext|>", "single_word": false, "lstrip": false, "rstrip": false, "normalized": true}, "pad_token": "<|endoftext|>"}
|
ckpts/text_encoder_2/tf_model.h5
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:7f154e925c18270d662d28f6261523c2ff6e80f1f05292cb034db41d5951c7a4
|
3 |
+
size 1711114176
|
ckpts/text_encoder_2/tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
ckpts/text_encoder_2/tokenizer_config.json
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"unk_token": {
|
3 |
+
"content": "<|endoftext|>",
|
4 |
+
"single_word": false,
|
5 |
+
"lstrip": false,
|
6 |
+
"rstrip": false,
|
7 |
+
"normalized": true,
|
8 |
+
"__type": "AddedToken"
|
9 |
+
},
|
10 |
+
"bos_token": {
|
11 |
+
"content": "<|startoftext|>",
|
12 |
+
"single_word": false,
|
13 |
+
"lstrip": false,
|
14 |
+
"rstrip": false,
|
15 |
+
"normalized": true,
|
16 |
+
"__type": "AddedToken"
|
17 |
+
},
|
18 |
+
"eos_token": {
|
19 |
+
"content": "<|endoftext|>",
|
20 |
+
"single_word": false,
|
21 |
+
"lstrip": false,
|
22 |
+
"rstrip": false,
|
23 |
+
"normalized": true,
|
24 |
+
"__type": "AddedToken"
|
25 |
+
},
|
26 |
+
"pad_token": "<|endoftext|>",
|
27 |
+
"add_prefix_space": false,
|
28 |
+
"errors": "replace",
|
29 |
+
"do_lower_case": true,
|
30 |
+
"name_or_path": "openai/clip-vit-base-patch32",
|
31 |
+
"model_max_length": 77,
|
32 |
+
"special_tokens_map_file": "./special_tokens_map.json",
|
33 |
+
"tokenizer_class": "CLIPTokenizer"
|
34 |
+
}
|
ckpts/text_encoder_2/vocab.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|