2_text_test.sh 708 Bytes
Newer Older
chenpangpang's avatar
chenpangpang committed
1
#!/bin/bash
2
TARGET_DIR=gpu-base-image-test
chenpangpang's avatar
chenpangpang committed
3
4
5
6
7
8
9
10
11
12
# 检查是否提供了输入参数
if [ -z "$1" ]; then
  echo "please set input image"
  exit 1
fi

if [[ "$1" == *"pytorch"* ]]; then \
  docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace/pytorch/gpt2 $1 python infer.py; fi

if [[ "$1" == *"tensorflow"* ]]; then \
chenpangpang's avatar
chenpangpang committed
13
14
15
16
17
  docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace/tensorflow/bert $1 python infer.py; fi
if [[ "$1" == *"paddle"* ]]; then \
   TARGET_DIR=gpu-base-image-test/paddletest \
   docker run --rm --platform=linux/amd64 --gpus all -v ./$TARGET_DIR:/workspace --workdir /workspace $1 python text.py; fi