---
title: 执行验证
description: "获取模型文件，执行测试验证环境部署是否成功。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengai/tuningguide/imog_a800ia2/kunpengai_800i_05_0005.html
sourcePath: /source/zh/kunpengai/tuningguide/imog_a800ia2/kunpengai_800i_05_0005.html
indexId: c29281476ecded622149409bfd7a625ad656fb0f727bfa3906dcc18a0ad7589273
---
# 执行验证

获取模型文件，执行测试验证环境部署是否成功。

1. 获取DeepSeek-R1-Distill-Llama-70B模型文件。
  模型文件可以从HuggingFace或ModelScope等网站获得，本文的模型文件从ModelScope(https://modelscope.cn/models/deepseek-ai/DeepSeek-R1-Distill-Llama-70B/files)获取，单击“下载模型”，根据提示获取模型文件后存放至“/home/models/DeepSeek-R1-Distill-Llama-70B/”目录。

2. 使用“vllm/examples/offline_inference/basic/basic.py”进行测试，basic.py测试代码示例如下所示，请将模型路径替换成本地模型文件路径。

```
# SPDX-License-Identifier: Apache-2.0
from vllm import LLM, SamplingParams
# Sample prompts.
prompts = [
"Hello, my name is",
"The president of the United States is",
"The capital of France is",
"The future of AI is",
]
# Create a sampling params object.
sampling_params = SamplingParams(temperature=0.8, top_p=0.95)
# Create an LLM.
llm = LLM(model="/home/models/DeepSeek-R1-Distill-Llama-70B/", tensor_parallel_size=8) # 此处修改为本地模型路径，并修改使用的NPU数量以保证可以运行
# Generate texts from the prompts. The output is a list of RequestOutput objects
# that contain the prompt, generated text, and other information.
outputs = llm.generate(prompts, sampling_params)
# Print the outputs.
for output in outputs:
prompt = output.prompt
generated_text = output.outputs[0].text
print(f"Prompt: {prompt!r}, Generated text: {generated_text!r}")
```


3. 执行测试命令。

```
python3 basic.py
```


  模型运行正常，未输出乱码，输出语句通顺即可认为环境正常配置。
