forked from vllm-project/vllm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed broken of download models from modelscope
- Loading branch information
mulin.lyh
committed
Jun 3, 2024
1 parent
7a64d24
commit 35e0892
Showing
3 changed files
with
41 additions
and
7 deletions.
There are no files selected for viewing
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,24 @@ | ||
import asyncio | ||
import pytest | ||
|
||
from vllm import LLM, SamplingParams | ||
|
||
# model: https://modelscope.cn/models/qwen/Qwen1.5-0.5B-Chat/summary | ||
MODEL_NAME = "qwen/Qwen1.5-0.5B-Chat" | ||
|
||
|
||
def test_offline_inference(monkeypatch): | ||
monkeypatch.setenv("VLLM_USE_MODELSCOPE", "True") | ||
llm = LLM(model=MODEL_NAME) | ||
|
||
prompts = [ | ||
"Hello, my name is", | ||
"The president of the United States is", | ||
"The capital of France is", | ||
"The future of AI is", | ||
] | ||
sampling_params = SamplingParams(temperature=0.8, top_p=0.95) | ||
|
||
outputs = llm.generate(prompts, sampling_params) | ||
assert len(outputs) == 4 | ||
|
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