File tree Expand file tree Collapse file tree 5 files changed +33
-201
lines changed Expand file tree Collapse file tree 5 files changed +33
-201
lines changed Original file line number Diff line number Diff line change @@ -176,6 +176,21 @@ function build_and_install() {
176
176
cd ..
177
177
}
178
178
179
+ function version_info() {
180
+ output_file=" fastdeploy/version.txt"
181
+ fastdeploy_git_commit_id=$( git rev-parse HEAD)
182
+ paddle_version=$( ${python} -c " import paddle; print(paddle.__version__)" )
183
+ paddle_git_commit_id=$( ${python} -c " import paddle; print(paddle.version.show())" | grep -Po " (?<=commit: )[\da-f]+" )
184
+ cuda_version=$( nvcc -V | grep -Po " (?<=release )[\d.]+(?=, V)" )
185
+ cxx_version=$( g++ --version | head -n 1 | grep -Po " (?<=\) )[\d.]+" )
186
+
187
+ echo " fastdeploy GIT COMMIT ID: $fastdeploy_git_commit_id " > $output_file
188
+ echo " Paddle version: $paddle_version " >> $output_file
189
+ echo " Paddle GIT COMMIT ID: $paddle_git_commit_id " >> $output_file
190
+ echo " CUDA version: $cuda_version " >> $output_file
191
+ echo " CXX compiler version: $cxx_version " >> $output_file
192
+ }
193
+
179
194
function cleanup() {
180
195
rm -rf $BUILD_DIR $EGG_DIR
181
196
if [ ` ${python} -m pip list | grep fastdeploy | wc -l` -gt 0 ]; then
@@ -207,6 +222,7 @@ if [ "$BUILD_WHEEL" -eq 1 ]; then
207
222
set -e
208
223
209
224
init
225
+ version_info
210
226
build_and_install_ops
211
227
build_and_install
212
228
cleanup
@@ -237,6 +253,7 @@ if [ "$BUILD_WHEEL" -eq 1 ]; then
237
253
else
238
254
init
239
255
build_and_install_ops
256
+ version_info
240
257
rm -rf $BUILD_DIR $EGG_DIR $DIST_DIR
241
258
rm -rf $OPS_SRC_DIR /$BUILD_DIR $OPS_SRC_DIR /$EGG_DIR
242
259
fi
Original file line number Diff line number Diff line change 22
22
os .environ ["GLOG_minloglevel" ] = "2"
23
23
# suppress log from aistudio
24
24
os .environ ["AISTUDIO_LOG" ] = "critical"
25
+ from fastdeploy .utils import version
25
26
from fastdeploy .engine .sampling_params import SamplingParams
26
27
from fastdeploy .entrypoints .llm import LLM
27
28
Original file line number Diff line number Diff line change @@ -562,6 +562,19 @@ def is_list_of(
562
562
563
563
assert_never (check )
564
564
565
+ def version ():
566
+ """
567
+ Prints the contents of the version.txt file located in the parent directory of this script.
568
+ """
569
+ current_dir = os .path .dirname (os .path .abspath (__file__ ))
570
+ version_file_path = os .path .join (current_dir , 'version.txt' )
571
+
572
+ try :
573
+ with open (version_file_path , 'r' ) as f :
574
+ content = f .read ()
575
+ print (content )
576
+ except FileNotFoundError :
577
+ llm_logger .error ("[version.txt] Not Found!" )
565
578
566
579
llm_logger = get_logger ("fastdeploy" , "fastdeploy.log" )
567
580
data_processor_logger = get_logger ("data_processor" , "data_processor.log" )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -189,7 +189,8 @@ def get_name():
189
189
"model_executor/ops/xpu/libs/*" ,
190
190
"model_executor/ops/npu/*" , "model_executor/ops/base/*" ,
191
191
"model_executor/models/*" , "model_executor/layers/*" ,
192
- "input/mm_processor/utils/*"
192
+ "input/mm_processor/utils/*" ,
193
+ "version.txt"
193
194
]
194
195
},
195
196
install_requires = load_requirements (),
You can’t perform that action at this time.
0 commit comments