Skip to content

Commit

Permalink
llm
Browse files Browse the repository at this point in the history
  • Loading branch information
wangzheng422 committed Nov 29, 2023
1 parent 0f7e173 commit 537573c
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 3 deletions.
24 changes: 22 additions & 2 deletions redhat/notes/2023/2023.11.rhel.gpu.llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ VAR_NAME_FULL=${VAR_NAME//\//-}
echo $VAR_NAME_FULL
# THUDM-ChatGLM2-6B

mkdir -p /data01/huggingface/${VAR_VAR_NAME_FULLNAME}
mkdir -p /data01/huggingface/${VAR_NAME_FULL}
cd /data01/huggingface/${VAR_NAME_FULL}

while true; do
Expand All @@ -101,7 +101,7 @@ VAR_NAME_FULL=${VAR_NAME//\//-}
echo $VAR_NAME_FULL
# moka-ai-m3e-large

mkdir -p /data01/huggingface/${VAR_VAR_NAME_FULLNAME}
mkdir -p /data01/huggingface/${VAR_NAME_FULL}
cd /data01/huggingface/${VAR_NAME_FULL}

while true; do
Expand All @@ -112,6 +112,26 @@ while true; do
sleep 1 # Optional: waits for 1 second before trying again
done

################
# for Llama-2-7b-chat-hf

VAR_NAME=meta-llama/Llama-2-7b-chat-hf

VAR_NAME_FULL=${VAR_NAME//\//-}
echo $VAR_NAME_FULL
# meta-llama-Llama-2-7b-chat-hf

mkdir -p /data01/huggingface/${VAR_NAME_FULL}
cd /data01/huggingface/${VAR_NAME_FULL}

while true; do
huggingface-cli download --token ${HUGGINGFACE_TOKEN} --repo-type model --revision main --cache-dir /data01/huggingface/cache --local-dir ./ --local-dir-use-symlinks False --resume-download ${VAR_NAME}
if [ $? -eq 0 ]; then
break
fi
sleep 1 # Optional: waits for 1 second before trying again
done

```

# 运行LLM应用
Expand Down
88 changes: 87 additions & 1 deletion redhat/ocp4/4.13/4.13.gpu.llm.md
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,90 @@ oc create -f custom-manifests/opendatahub/kserve-dsc.yaml
### create minio image (todo)
#### on helper
```bash

# on helper

mkdir -p /data01/git_env

cd /data01/git_env

git clone https://github.com/wangzheng422/modelmesh-minio-examples

cd modelmesh-minio-examples

git checkout wzh

/bin/cp -r /data01/huggingface/meta-llama-Llama-2-7b-chat-hf ./Llama-2-7b-chat-hf

mv Llama-2-7b-chat-hf llama2

mkdir -p ./Llama-2-7b-chat-hf/artifacts
/bin/mv ./llama2/* ./Llama-2-7b-chat-hf/artifacts/
rm -rf llama2/


podman build -t quaylab.infra.wzhlab.top:5443/wangzheng422/qimgs:modelmesh-minio-llama-2-7b-chat-hf -f Dockerfile .

podman push quaylab.infra.wzhlab.top:5443/wangzheng422/qimgs:modelmesh-minio-llama-2-7b-chat-hf


```
#### on vultr
```bash

# on vultr

mkdir -p /data/env/
conda create -y -p /data/env/chatchat python=3.10

conda init bash

conda activate /data/env/chatchat
# conda deactivate

pip install --upgrade huggingface_hub



mkdir -p /data/git

cd /data/git

git clone https://github.com/wangzheng422/modelmesh-minio-examples

cd modelmesh-minio-examples

git checkout wzh

# on helper
# for chatglm2-6b
VAR_NAME=meta-llama/Llama-2-7b-chat-hf

VAR_NAME_FULL=${VAR_NAME#*/}
echo $VAR_NAME_FULL
# Llama-2-7b-chat-hf

mkdir -p ${VAR_NAME_FULL}

while true; do
huggingface-cli download --token ${HUGGINGFACE_TOKEN} --repo-type model --revision main --local-dir ./${VAR_NAME_FULL} --local-dir-use-symlinks False --resume-download ${VAR_NAME}
if [ $? -eq 0 ]; then
break
fi
sleep 1 # Optional: waits for 1 second before trying again
done


podman build -t quay.io/wangzheng422/qimgs:modelmesh-minio-llama-2-7b-chat-hf -f Dockerfile .

podman push quay.io/wangzheng422/qimgs:modelmesh-minio-llama-2-7b-chat-hf



```
Expand Down Expand Up @@ -1344,7 +1426,11 @@ SECRET_ACCESS_KEY=password
MINIO_NS=minio

oc new-project ${MINIO_NS}
oc apply -f ./custom-manifests/minio/minio.yaml -n ${MINIO_NS}

sed "s|image: .*|image: quaylab.infra.wzhlab.top:5443/wangzheng422/qimgs:modelmesh-minio-llama-2-7b-chat-hf|g" ./custom-manifests/minio/minio.yaml | tee ./minio-current.yaml | oc -n ${MINIO_NS} apply -f -

# oc apply -f ./custom-manifests/minio/minio.yaml -n ${MINIO_NS}

sed "s/<minio_ns>/$MINIO_NS/g" ./custom-manifests/minio/minio-secret.yaml | tee ./minio-secret-current.yaml | oc -n ${MINIO_NS} apply -f -
sed "s/<minio_ns>/$MINIO_NS/g" ./custom-manifests/minio/serviceaccount-minio.yaml | tee ./serviceaccount-minio-current.yaml | oc -n ${MINIO_NS} apply -f -

Expand Down

0 comments on commit 537573c

Please sign in to comment.