add_xcomposer_testcase
zhulin1 2024-07-17 10:40:23 +08:00
parent f3b3e740a8
commit b9f53ef6cc
2 changed files with 6 additions and 5 deletions

View File

@ -41,8 +41,8 @@ jobs:
source activate internlm-model-latest
pip install torch==2.2.2 torchvision==0.17.2 --index-url https://download.pytorch.org/whl/cu118
pip install /mnt/petrelfs/qa-caif-cicd/resource/flash_attn-2.5.8+cu118torch2.2cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
pip install sentencepiece auto-gptq==0.6.0 lmdeploy[all] beautifulsoup4 decord lxml
srun -p ${SLURM_PARTITION} --kill-on-bad-exit=1 --job-name=${GITHUB_RUN_ID}-${GITHUB_JOB} --gpus-per-task=2 pytest -s -v -m tmp --color=yes ./tests/test_hf_model.py
pip install sentencepiece auto-gptq==0.6.0 lmdeploy[all]==0.5.0 beautifulsoup4 decord lxml
srun -p ${SLURM_PARTITION} --kill-on-bad-exit=1 --job-name=${GITHUB_RUN_ID}-${GITHUB_JOB} --gpus-per-task=2 pytest -s -v --color=yes ./tests/test_hf_model.py
conda deactivate
- name: remove_env
if: always()

View File

@ -282,7 +282,6 @@ class InternLMXComposer2QForCausalLM(BaseGPTQForCausalLM):
]
@pytest.mark.tmp
class TestXcomposer2d5Model:
"""Test cases for base model."""
@ -298,7 +297,7 @@ class TestXcomposer2d5Model:
# init model and tokenizer
model = AutoModel.from_pretrained(
model_name, torch_dtype=torch.bfloat16,
trust_remote_code=True).cuda().eval()
trust_remote_code=True).cuda().eval().half()
tokenizer = AutoTokenizer.from_pretrained(model_name,
trust_remote_code=True)
model.tokenizer = tokenizer
@ -394,7 +393,9 @@ class TestXcomposer2d5Model:
model.tokenizer = tokenizer
query = 'Generate the HTML code of this web image with Tailwind CSS.'
image = ['/mnt/petrelfs/qa-caif-cicd/github_runner/examples/screenshot.jpg']
image = [
'/mnt/petrelfs/qa-caif-cicd/github_runner/examples/screenshot.jpg'
]
with torch.autocast(device_type='cuda', dtype=torch.float16):
response = model.resume_2_webpage(query,
image,