Tencent / HunyuanDiT

Hunyuan-DiT : A Powerful Multi-Resolution Diffusion Transformer with Fine-Grained Chinese Understanding
https://dit.hunyuan.tencent.com/
Other
2.63k stars 190 forks source link

linux服务器没有搭梯子,想在本地下载后上传到相关位置,但是不知道应该放在哪里。请问方便提供一下吗? #56

Closed equinox-sun closed 1 month ago

equinox-sun commented 1 month ago

目前下载了模型,是将整个ckpts目录放到了根目录,感觉是正确的。 运行python app/hydit_app.py 时提示pytorch_model.bin 下载超时,在本地下载后,不知道应该放在哪里。 请问方便指路吗?谢谢 如果能够给出其它需要fq的文件,超级感谢!

yestinl commented 1 month ago

如果是clip-vit-large-patch14-336模型文件,则放到 ./ckpts/dialoggen/openai/clip-vit-large-patch14-336即可

equinox-sun commented 1 month ago

如果是clip-vit-large-patch14-336模型文件,则放到 ./ckpts/dialoggen/openai/clip-vit-large-patch14-336即可

放到了对应文件夹后,还是执行了下载操作,并且超时失败。 输出日志时,init dialoggen model时,model path:ckpts/dialoggen model base:none , 那应该是能够加载本地的,不明白为什么还是不对。

python app/hydit_app.py

2024-05-23 11:26:43.725 | INFO     | hydit.inference:__init__:159 - Got text-to-image model root path: ckpts/t2i

2024-05-23 11:26:43.725 | INFO     | hydit.inference:__init__:171 - Loading CLIP Text Encoder...

2024-05-23 11:26:48.500 | INFO     | hydit.inference:__init__:174 - Loading CLIP Text Encoder finished

2024-05-23 11:26:48.500 | INFO     | hydit.inference:__init__:177 - Loading CLIP Tokenizer...

2024-05-23 11:26:48.549 | INFO     | hydit.inference:__init__:180 - Loading CLIP Tokenizer finished

2024-05-23 11:26:48.550 | INFO     | hydit.inference:__init__:183 - Loading T5 Text Encoder and T5 Tokenizer...

You are using the default legacy behaviour of the <class 'transformers.models.t5.tokenization_t5.T5Tokenizer'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565
/home/mk/anaconda3/envs/hunyuan/lib/python3.8/site-packages/transformers/convert_slow_tokenizer.py:515: UserWarning: The sentencepiece tokenizer that you are converting to a fast tokenizer uses the byte fallback option which is not implemented in the fast tokenizers. In practice this means that the fast version of the tokenizer can produce unknown tokens whereas the sentencepiece version would have converted these unknown tokens into a sequence of byte tokens matching the original piece of text.
  warnings.warn(
You are using a model of type mt5 to instantiate a model of type t5. This is not supported for all configurations of models and can yield errors.

2024-05-23 11:27:13.571 | INFO     | hydit.inference:__init__:187 - Loading t5_text_encoder and t5_tokenizer finished
2024-05-23 11:27:13.571 | INFO     | hydit.inference:__init__:190 - Loading VAE...
2024-05-23 11:27:13.717 | INFO     | hydit.inference:__init__:193 - Loading VAE finished
2024-05-23 11:27:13.718 | INFO     | hydit.inference:__init__:197 - Building HunYuan-DiT model...
2024-05-23 11:27:14.794 | INFO     | hydit.modules.models:__init__:229 -     Number of tokens: 4096
2024-05-23 11:27:36.431 | INFO     | hydit.inference:__init__:217 - Loading model checkpoint ckpts/t2i/model/pytorch_model_ema.pt...
2024-05-23 11:27:40.202 | INFO     | hydit.inference:__init__:228 - Loading inference pipeline...
2024-05-23 11:27:40.224 | INFO     | hydit.inference:__init__:230 - Loading pipeline finished
2024-05-23 11:27:40.225 | INFO     | hydit.inference:__init__:234 - ==================================================
2024-05-23 11:27:40.225 | INFO     | hydit.inference:__init__:235 -                 Model is ready.                  
2024-05-23 11:27:40.225 | INFO     | hydit.inference:__init__:236 - ==================================================
2024-05-23 11:27:40.296 | INFO     | sample_t2i:inferencer:21 - Loading DialogGen model (for prompt enhancement)...
2024-05-23 11:27:40.296 | INFO     | dialoggen.dialoggen_demo:init_dialoggen_model:57 - model_name:dialoggen
2024-05-23 11:27:40.296 | INFO     | dialoggen.dialoggen_demo:init_dialoggen_model:58 - model:ckpts/dialoggen None

/home/mk/anaconda3/envs/hunyuan/lib/python3.8/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
pytorch_model.bin:  19%|███████████████████████████████████████████▎                                                                                                                                                                                        | 325M/1.71G [01:30<56:29, 409kB/s]Error while downloading from https://cdn-lfs.huggingface.co/repos/aa/ef/aaef666503e18a889e4a927d9595921c7011b713a81cf619fbc411be6f69e9d6/c6032c2e0caae3dc2d4fba35535fa6307dbb49df59c7e182b1bc4b3329b81801?response-content-disposition=attachment%3B+filename*%3DUTF-8%27%27pytorch_model.bin%3B+filename%3D%22pytorch_model.bin%22%3B&response-content-type=application%2Foctet-stream&Expires=1716722212&Policy=eyJTdGF0ZW1lbnQiOlt7IkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTcxNjcyMjIxMn19LCJSZXNvdXJjZSI6Imh0dHBzOi8vY2RuLWxmcy5odWdnaW5nZmFjZS5jby9yZXBvcy9hYS9lZi9hYWVmNjY2NTAzZTE4YTg4OWU0YTkyN2Q5NTk1OTIxYzcwMTFiNzEzYTgxY2Y2MTlmYmM0MTFiZTZmNjllOWQ2L2M2MDMyYzJlMGNhYWUzZGMyZDRmYmEzNTUzNWZhNjMwN2RiYjQ5ZGY1OWM3ZTE4MmIxYmM0YjMzMjliODE4MDE%7EcmVzcG9uc2UtY29udGVudC1kaXNwb3NpdGlvbj0qJnJlc3BvbnNlLWNvbnRlbnQtdHlwZT0qIn1dfQ__&Signature=WZ%7Ed1p6upXfb5tmCcPX6yxozbcMvuE60XZyXyC5lSM9flBCpFySTp1tusPQ2cYsSMRK0GL%7Ep22qHNajTpAYDr24t2g2Y9NFjjlMvhKsPlO0ITbmRwdevWKTL58MT2biRbq2K57DgAi%7ETu6ovB5c9DRYIk9w-n4khSzx7aELy4HSyj-GT-L-siXZ61CPXVlqbh2iXa6ufz5xvgxr8n-3ht3Xw-aYjHeN5HjxRQXT%7EhIZ8aNg%7E0DYaYOXaNCWy8uq90umPXCsU5cc3GVQDl4jcdl82mW-P9ul89R4mN6Mc2iMadEgxw0r70pBAKwudqVhEyxQ2Rfhg0wuPwjrdHmGSeg__&Key-Pair-Id=KVTP0A1DKRTAX: HTTPSConnectionPool(host='cdn-lfs.huggingface.co', port=443): Read timed out.
Trying to resume download...
yestinl commented 1 month ago

@equinox-sun 因为我们已经在dialoggen 指定了 https://huggingface.co/Tencent-Hunyuan/HunyuanDiT/blob/main/dialoggen/config.json#L50 clip-vit的模型读取路径。 如果模型放置的路径正确,且模型正确下载完整的话,应该不会出现这个问题。你可以再检查一下。

如果仍然有问题,你可以尝试重新在新的文件夹拉取huggingface的HunyuanDiT项目的模型文件。参考 https://github.com/Tencent/HunyuanDiT?tab=readme-ov-file#-download-pretrained-models。 我们已经把clip-vit的模型也已经放置到huggingface的HunyuanDiT模型仓库中。

jnulzl commented 4 weeks ago

@equinox-sun

Solved by below changed:

dialoggen/config.json#L50

"mm_vision_tower": "openai/clip-vit-large-patch14-336",

—>

"mm_vision_tower": "ckpts/dialoggen/openai/clip-vit-large-patch14-336",
KazusaKitakawa commented 12 hours ago

it works for me!