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
ModelZoo
BERT_onnxruntime
Commits
ae781c54
Commit
ae781c54
authored
Aug 19, 2024
by
yangql
Browse files
增加对dtk24.04.1的支持,以及对k100_AI的支持。
parent
5a3df022
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
9 additions
and
9 deletions
+9
-9
CMakeLists.txt
CMakeLists.txt
+1
-0
README.md
README.md
+2
-2
Src/Bert.cpp
Src/Bert.cpp
+0
-1
Src/Bert.h
Src/Bert.h
+2
-2
Src/Utility/Filesystem.cpp
Src/Utility/Filesystem.cpp
+2
-2
Src/Utility/SimpleLog.h
Src/Utility/SimpleLog.h
+1
-1
docker/Dockerfile
docker/Dockerfile
+1
-1
No files found.
CMakeLists.txt
View file @
ae781c54
...
...
@@ -13,6 +13,7 @@ set(CMAKE_BUILD_TYPE release)
set
(
INCLUDE_PATH
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/
${
CMAKE_CURRENT_SOURCE_DIR
}
/Src/Utility/
$ENV{DTKROOT}/include/
$ENV{DTKROOT}/onnxruntime/include/
${
CMAKE_CURRENT_SOURCE_DIR
}
/depend/include/
)
include_directories
(
${
INCLUDE_PATH
}
)
...
...
README.md
View file @
ae781c54
...
...
@@ -23,13 +23,13 @@ Segment Embedding:表明这个词属于哪个句子(NSP需要两个句子)
拉取镜像:
```
docker pull image.sourcefind.cn:5000/dcu/admin/base/
custom:ort1.14.0_migraphx3.
0.0-dtk2
2.10.1
docker pull image.sourcefind.cn:5000/dcu/admin/base/
migraphx:4.3.0-ubuntu2
0.0
4
-dtk2
4.04.1-py3.10
```
创建并启动容器,安装相关依赖:
```
docker run --shm-size 16g --network=host --name=bert_o
rt
--privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/bert_onnxruntime:/home/bert_onnxruntime -it <Your Image ID> /bin/bash
docker run --shm-size 16g --network=host --name=bert_o
nnxruntime -v /opt/hyhal:/opt/hyhal:ro
--privileged --device=/dev/kfd --device=/dev/dri --group-add video --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $PWD/bert_onnxruntime:/home/bert_onnxruntime -it <Your Image ID> /bin/bash
# 激活dtk
source /opt/dtk/env.sh
...
...
Src/Bert.cpp
View file @
ae781c54
#include <Bert.h>
#include <onnxruntime/core/session/onnxruntime_cxx_api.h>
#include <Filesystem.h>
#include <SimpleLog.h>
#include <algorithm>
...
...
Src/Bert.h
View file @
ae781c54
...
...
@@ -3,7 +3,7 @@
#include <cstdint>
#include <string>
#include <onnxruntime
/core/session/onnxruntime
_cxx_api.h>
#include <onnxruntime_cxx_api.h>
#include <tokenization.h>
namespace
ortSamples
...
...
@@ -71,4 +71,4 @@ private:
}
#endif
\ No newline at end of file
#endif
Src/Utility/Filesystem.cpp
View file @
ae781c54
...
...
@@ -679,9 +679,9 @@ static std::vector<std::string> SplitString(std::string str, std::string separat
// process
double
process
=
(
1.0
*
(
i
+
1
)
/
fileNameList
.
size
())
*
100
;
printf
(
"%s done! %f
%
\n
"
,
GetFileName
(
fileNameList
[
i
]).
c_str
(),
process
);
printf
(
"%s done! %f
\n
"
,
GetFileName
(
fileNameList
[
i
]).
c_str
(),
process
);
}
printf
(
"all done!(the number of files:%
d
)
\n
"
,
fileNameList
.
size
());
printf
(
"all done!(the number of files:%
zu
)
\n
"
,
fileNameList
.
size
());
return
true
;
...
...
Src/Utility/SimpleLog.h
View file @
ae781c54
...
...
@@ -141,7 +141,7 @@ inline LogTime GetTime()
SYSTEMTIME
systemTime
;
GetLocalTime
(
&
systemTime
);
char
temp
[
8
]
=
{
0
};
char
temp
[
12
]
=
{
0
};
sprintf
(
temp
,
"%04d"
,
systemTime
.
wYear
);
currentTime
.
year
=
string
(
temp
);
sprintf
(
temp
,
"%02d"
,
systemTime
.
wMonth
);
...
...
docker/Dockerfile
View file @
ae781c54
FROM
image.sourcefind.cn:5000/dcu/admin/base/
custom:ort1.14.0_migraphx3.
0.0-dtk2
2.10.1
FROM
image.sourcefind.cn:5000/dcu/admin/base/
migraphx:4.3.0-ubuntu2
0.0
4
-dtk2
4.04.1-py3.10
RUN
source
/opt/dtk/env.sh
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