57 lines
2.6 KiB
Bash
57 lines
2.6 KiB
Bash
# # Patch prep_env.sh for zsh compatibility (only if not already patched)
|
|
# _prep_env="/workspace/vscode/prep_env.sh"
|
|
# if [[ -f "$_prep_env" ]] && ! grep -q '# PATCHED_FOR_ZSH' "$_prep_env" 2>/dev/null; then
|
|
# sed -i \
|
|
# -e '1a# PATCHED_FOR_ZSH' \
|
|
# -e 's/^shopt -s histappend$/[[ -n "${BASH_VERSION}" ]] \&\& shopt -s histappend/' \
|
|
# -e 's/\${!\([^}]*\)}/\$( [[ -n "\${ZSH_VERSION}" ]] \&\& echo "\${(P)\1}" || echo "\${!\1}" )/g' \
|
|
# -e 's/cur_dir="\$(cd "\$(dirname "\$0")" && pwd)"/cur_dir="\/workspace\/vscode"/' \
|
|
# "$_prep_env"
|
|
# fi
|
|
|
|
# # Now source the patched script directly
|
|
# source "$_prep_env"
|
|
|
|
|
|
|
|
# Set cur_dir before sourcing so prep_env.sh uses the correct path
|
|
export cur_dir="/workspace/vscode"
|
|
|
|
# Patch prep_env.sh for zsh compatibility before sourcing
|
|
source <(sed -e 's/^shopt -s histappend$/[[ -n "${BASH_VERSION}" ]] \&\& shopt -s histappend/' \
|
|
-e 's/\${!\([^}]*\)}/${(P)\1}/g' \
|
|
-e 's/cur_dir="\$(cd "\$(dirname "\$0")" && pwd)"/# cur_dir already set/g' \
|
|
/workspace/mlx/../vscode/prep_env.sh)
|
|
|
|
# sh -c /opt/tiger/mlx_deploy/greeting.sh
|
|
|
|
if [ -f "/opt/tiger/mlx_deploy/pythonpath_rc" ]; then
|
|
source /opt/tiger/mlx_deploy/pythonpath_rc
|
|
fi
|
|
|
|
if [ -f "/opt/tiger/rh2_bashrc" ]; then
|
|
source /opt/tiger/rh2_bashrc
|
|
fi
|
|
|
|
. "$HOME/.cargo/env"
|
|
|
|
# huggingface proxy
|
|
export HF_NETWORK_PROXY=http://huggingface-proxy-sg.byted.org
|
|
export HF_MIRROR_INTERNAL=http://huggingface-mirror.bytedance.net
|
|
export HF_MIRROR_EXTERNAL=https://hf-mirror.com
|
|
export HF_ENDPOINT=$HF_NETWORK_PROXY
|
|
alias hf_network_proxy='export HF_ENDPOINT=$HF_NETWORK_PROXY'
|
|
alias hf_mirror_internal='export HF_ENDPOINT=$HF_MIRROR_INTERNAL'
|
|
alias hf_mirror_external='export HF_ENDPOINT=$HF_MIRROR_EXTERNAL'
|
|
|
|
# http proxy
|
|
export HTTP_PROXY=http://sys-proxy-rd-relay.byted.org:8118
|
|
export HTTPS_PROXY=http://sys-proxy-rd-relay.byted.org:8118
|
|
export NO_PROXY=byted.org,bytedance.net,10.*.*.*,127.*.*.*
|
|
export http_proxy=http://sys-proxy-rd-relay.byted.org:8118
|
|
export https_proxy=http://sys-proxy-rd-relay.byted.org:8118
|
|
export no_proxy=byted.org,bytedance.net,10.*.*.*,127.*.*.*
|
|
|
|
alias proxy_on='export http_proxy=http://sys-proxy-rd-relay.byted.org:8118; export https_proxy=http://sys-proxy-rd-relay.byted.org:8118; export no_proxy=byted.org,bytedance.net,10.*.*.*,127.*.*.*; export HTTP_PROXY=http://sys-proxy-rd-relay.byted.org:8118; export HTTPS_PROXY=http://sys-proxy-rd-relay.byted.org:8118; export NO_PROXY=byted.org,bytedance.net,10.*.*.*,127.*.*.*'
|
|
alias proxy_off='unset http_proxy; unset https_proxy; unset no_proxy; unset HTTP_PROXY; unset HTTPS_PROXY; unset NO_PROXY'
|