-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI add inference test for llama-2-7b-chat-hf (#144)
Signed-off-by: jiafu zhang <jiafu.zhang@intel.com>
- Loading branch information
Showing
4 changed files
with
80 additions
and
5 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
.github/workflows/chatbot-inference-llama-2-7b-chat-hf.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Chatbot inference on llama-2-7b-chat-hf | ||
|
||
on: | ||
workflow_call: | ||
|
||
# If there is a new commit, the previous jobs will be canceled | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
inference: | ||
name: inference test | ||
runs-on: lms-lab | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build Docker Image | ||
run: docker build ./ --target cpu --build-arg http_proxy="$HTTP_PROXY_IMAGE_BUILD" --build-arg https_proxy="$HTTPS_PROXY_IMAGE_BUILD" -f workflows/chatbot/inference/docker/Dockerfile -t chatbotinfer:latest && yes | docker container prune && yes | docker image prune | ||
|
||
- name: Start Docker Container | ||
run: | | ||
cid=$(docker ps -q --filter "name=chatbotinfer") | ||
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid; fi | ||
docker run -tid -v /mnt/DP_disk1/huggingface/cache/:/root/.cache/huggingface/hub -v .:/root/chatbot -e http_proxy="$HTTP_PROXY_CONTAINER_RUN" -e https_proxy="$HTTPS_PROXY_CONTAINER_RUN" --name="chatbotinfer" --hostname="chatbotinfer-container" chatbotinfer:latest | ||
- name: Run Inference Test | ||
run: | | ||
docker exec "chatbotinfer" bash -c "cd /root/chatbot && source activate && conda activate chatbot-demo; python workflows/chatbot/inference/generate.py --base_model_path \"meta-llama/Llama-2-7b-chat-hf\" --hf_access_token \"$HF_ACCESS_TOKEN\" --instructions \"Transform the following sentence into one that shows contrast. The tree is rotten.\" " | ||
- name: Stop Container | ||
if: success() || failure() | ||
run: | | ||
cid=$(docker ps -q --filter "name=chatbotinfer") | ||
if [[ ! -z "$cid" ]]; then docker stop $cid && docker rm $cid; fi | ||
- name: Test Summary | ||
run: echo "Inference completed successfully" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Chat Bot Test | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- './requirements.txt' | ||
- '.github/workflows/chatbot-test.yml' | ||
- '.github/workflows/chatbot-inference-llama-2-7b-chat-hf.yml' | ||
- 'intel_extension_for_transformers/**' | ||
- 'workflows/chatbot/inference/**' | ||
- 'workflows/dlsa/**' | ||
- 'workflows/hf_finetuning_and_inference_nlp/**' | ||
|
||
workflow_dispatch: | ||
|
||
# If there is a new commit, the previous jobs will be canceled | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
call-inference-llama-2-7b-chat-hf: | ||
uses: ./.github/workflows/chatbot-inference-llama-2-7b-chat-hf.yml | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters