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
ec398f00
Commit
ec398f00
authored
Sep 18, 2024
by
chenpangpang
Browse files
feat: 在脚本中不拉取git代码
parent
1e0f9743
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
22 deletions
+0
-22
script/2_text_generate_test.sh
script/2_text_generate_test.sh
+0
-22
No files found.
script/2_text_generate_test.sh
View file @
ec398f00
#!/bin/bash
#!/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
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