mirror of
https://github.com/OpenSPG/openspg.git
synced 2025-07-09 10:06:32 +00:00
38 lines
1.2 KiB
Bash
Executable File
38 lines
1.2 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Copyright 2023 OpenSPG Authors
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
# in compliance with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
# or implied.
|
|
|
|
_SCRIPT_FILE_PATH="${BASH_SOURCE[0]}"
|
|
while [ -h ${_SCRIPT_FILE_PATH} ]
|
|
do
|
|
_SCRIPT_DIR_PATH=$(cd -P "$(dirname ${_SCRIPT_FILE_PATH})" && pwd)
|
|
_SCRIPT_FILE_PATH=$(readlink ${_SCRIPT_FILE_PATH})
|
|
case ${_SCRIPT_FILE_PATH} in
|
|
/*) ;;
|
|
*) _SCRIPT_FILE_PATH=${_SCRIPT_DIR_PATH}/${_SCRIPT_FILE_PATH} ;;
|
|
esac
|
|
done
|
|
_SCRIPT_DIR_PATH=$(cd -P "$(dirname ${_SCRIPT_FILE_PATH})" && pwd)
|
|
|
|
if [ -f ${_SCRIPT_DIR_PATH}/.env/requirements.txt ]
|
|
then
|
|
exit
|
|
fi
|
|
|
|
set -e
|
|
rm -rf ${_SCRIPT_DIR_PATH}/.env
|
|
python3 -m venv ${_SCRIPT_DIR_PATH}/.env
|
|
source ${_SCRIPT_DIR_PATH}/.env/bin/activate
|
|
python -m pip install --upgrade pip
|
|
python -m pip install transformers==4.37.2 peft==0.5.0 torch==2.0.0 deprecation==2.1.0
|
|
python -m pip freeze > ${_SCRIPT_DIR_PATH}/.env/requirements.txt
|