Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
CogVideoX-5B
Commits
8c11c85a
Commit
8c11c85a
authored
Aug 28, 2024
by
chenpangpang
Browse files
feat: fix bug
parent
58e1892d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
2 deletions
+49
-2
Dockerfile
Dockerfile
+4
-1
README.md
README.md
+4
-1
export-hf-model.py
export-hf-model.py
+31
-0
hf_down.py
hf_down.py
+10
-0
No files found.
Dockerfile
View file @
8c11c85a
...
...
@@ -17,7 +17,10 @@ COPY chenyh/$IMAGE/frpc_linux_amd64_v0.2 /opt/conda/lib/python3.10/site-packages
RUN
chmod
+x /opt/conda/lib/python3.10/site-packages/gradio/frpc_linux_amd64_v0.2
COPY
chenyh/$IMAGE/model_real_esran /root/$IMAGE_UPPER/model_real_esran
COPY
chenyh/$IMAGE/model_rife /root/$IMAGE_UPPER/model_rife
COPY
chenyh/$IMAGE/THUDM/CogVideoX-5b /root/$IMAGE_UPPER/THUDM/CogVideoX-5b
RUN
apt-get update
&&
apt-get
install
-y
libglib2.0-0 libgl1-mesa-glx
&&
apt-get clean
COPY
--from=base /opt/conda/lib/python3.10/site-packages /opt/conda/lib/python3.10/site-packages
COPY
--from=base /root/$IMAGE/$IMAGE_UPPER /root/$IMAGE_UPPER
COPY
--from=base /root/$IMAGE/启动器.ipynb /root/$IMAGE/start.sh /root/
COPY
--from=base /root/$IMAGE/assets /root/
\ No newline at end of file
COPY
--from=base /root/$IMAGE/assets /root/assets
README.md
View file @
8c11c85a
# CogVideoX-5B
-
在scnet上需要运行
```
python
transformers
.
utils
.
move_cache
()
```
\ No newline at end of file
export-hf-model.py
0 → 100644
View file @
8c11c85a
import
os
import
shutil
MODEL_NAME
=
"THUDM/CogVideoX-5b"
HF_CACHE_DIR
=
"/root/.cache/huggingface/hub/"
hash_code
=
None
for
cache_model_name
in
os
.
listdir
(
HF_CACHE_DIR
):
flag
=
False
for
model_name_str_split
in
MODEL_NAME
.
split
(
"/"
):
if
model_name_str_split
in
cache_model_name
:
flag
=
True
else
:
flag
=
False
break
if
flag
:
if
hash_code
is
None
:
full_path
=
os
.
path
.
join
(
HF_CACHE_DIR
,
cache_model_name
,
"snapshots"
,
os
.
listdir
(
os
.
path
.
join
(
HF_CACHE_DIR
,
cache_model_name
,
"snapshots"
))[
0
])
else
:
full_path
=
os
.
path
.
join
(
HF_CACHE_DIR
,
cache_model_name
,
"snapshots"
,
hash_code
)
os
.
makedirs
(
MODEL_NAME
,
exist_ok
=
True
)
for
filename
in
os
.
listdir
(
full_path
):
print
(
"copy: "
,
os
.
path
.
join
(
full_path
,
filename
),
" to "
,
os
.
path
.
join
(
MODEL_NAME
,
filename
))
if
os
.
path
.
isdir
(
os
.
path
.
join
(
full_path
,
filename
)):
shutil
.
copytree
(
os
.
path
.
join
(
full_path
,
filename
),
os
.
path
.
join
(
MODEL_NAME
,
filename
))
elif
os
.
path
.
isfile
(
os
.
path
.
join
(
full_path
,
filename
)):
shutil
.
copy
(
os
.
path
.
join
(
full_path
,
filename
),
os
.
path
.
join
(
MODEL_NAME
,
filename
))
else
:
raise
Exception
(
"path is not a file or directory: "
,
os
.
path
.
join
(
full_path
,
filename
))
hf_down.py
View file @
8c11c85a
...
...
@@ -8,3 +8,13 @@ from huggingface_hub import hf_hub_download, snapshot_download
hf_hub_download
(
repo_id
=
"ai-forever/Real-ESRGAN"
,
filename
=
"RealESRGAN_x4.pth"
,
local_dir
=
"model_real_esran"
)
snapshot_download
(
repo_id
=
"AlexWortega/RIFE"
,
local_dir
=
"model_rife"
)
os
.
environ
[
'HF_ENDPOINT'
]
=
'https://hf-mirror.com'
model_list
=
[
"THUDM/CogVideoX-5b"
]
for
model_path
in
model_list
:
os
.
system
(
f
"huggingface-cli download --resume-download
{
model_path
}
--local-dir ./
{
model_path
}
--local-dir-use-symlinks False"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment