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
gpu-base-image-build
Commits
9ee4e988
Commit
9ee4e988
authored
Sep 18, 2024
by
chenpangpang
Browse files
feat: add test script
parent
6b0dafac
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
script/1_base_test.sh
script/1_base_test.sh
+5
-1
script/2_text_generate_test.sh
script/2_text_generate_test.sh
+25
-0
No files found.
script/1_base_test.sh
View file @
9ee4e988
#!/bin/bash
#!/bin/bash
docker run
--rm
--platform
=
linux/amd64
--gpus
all
$1
python
-c
\
docker run
--rm
--platform
=
linux/amd64
--gpus
all
$1
python
-c
\
'import torch; \
'import sys; \
print("python version: ", sys.version); \
import torch; \
print("torch version: ", torch.__version__); \
print("torch version: ", torch.__version__); \
print("torch cuda available: ", torch.cuda.is_available()); \
print("torch cuda available: ", torch.cuda.is_available()); \
print("torch cuda version: ", torch.version.cuda); \
print("torch cudnn version: ",torch.backends.cudnn.version()); \
import torchvision; \
import torchvision; \
print("torchvision version: ", torchvision.__version__); \
print("torchvision version: ", torchvision.__version__); \
import torchaudio; \
import torchaudio; \
...
...
script/2_text_generate_test.sh
0 → 100644
View file @
9ee4e988
#!/bin/bash
# 设置要检查的目录和Git仓库的URL
TARGET_DIR
=
"gpu-base-image-test"
GIT_REPO
=
'http://developer.hpccube.com/codes/chenpangpang/gpu-base-image-test.git'
echo
"--------------------------拉取代码--------------------------"
# 检查目录是否存在
if
[
!
-d
"
$TARGET_DIR
"
]
;
then
echo
"目录 '
$TARGET_DIR
' 不存在,正在从Git拉取代码..."
# 尝试从Git拉取代码
git clone
$GIT_REPO
# 检查是否成功拉取
if
[
$?
-eq
0
]
;
then
echo
"代码拉取成功,目录已创建。"
else
echo
"拉取代码失败,请检查Git仓库URL或网络连接。"
exit
1
fi
else
echo
"目录
$TARGET_DIR
已存在,无需拉取。"
fi
echo
"--------------------------验证镜像--------------------------"
docker run
--rm
--platform
=
linux/amd64
--gpus
all
-v
./
$TARGET_DIR
:/workspace
--workdir
/workspace/gpt2
$1
python infer.py
\ No newline at end of file
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