Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
norm
vllm
Commits
4aaafdd2
Unverified
Commit
4aaafdd2
authored
Dec 27, 2023
by
Zhuohan Li
Committed by
GitHub
Dec 26, 2023
Browse files
[BUGFIX] Fix the path of test prompts (#2273)
parent
66b108d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
tests/conftest.py
tests/conftest.py
+5
-4
No files found.
tests/conftest.py
View file @
4aaafdd2
...
...
@@ -8,8 +8,9 @@ from transformers import AutoModelForCausalLM
from
vllm
import
LLM
,
SamplingParams
from
vllm.transformers_utils.tokenizer
import
get_tokenizer
_TEST_PROMPTS
=
[
"prompts/example.txt"
]
_LONG_PROMPTS
=
[
"prompts/summary.txt"
]
_TEST_DIR
=
os
.
path
.
dirname
(
__file__
)
_TEST_PROMPTS
=
[
os
.
path
.
join
(
_TEST_DIR
,
"prompts"
,
"example.txt"
)]
_LONG_PROMPTS
=
[
os
.
path
.
join
(
_TEST_DIR
,
"prompts"
,
"summary.txt"
)]
def
_read_prompts
(
filename
:
str
)
->
str
:
...
...
@@ -24,7 +25,7 @@ def _read_prompts(filename: str) -> str:
def
example_prompts
()
->
List
[
str
]:
prompts
=
[]
for
filename
in
_TEST_PROMPTS
:
prompts
+=
_read_prompts
(
os
.
path
.
join
(
"tests"
,
filename
)
)
prompts
+=
_read_prompts
(
filename
)
return
prompts
...
...
@@ -32,7 +33,7 @@ def example_prompts() -> List[str]:
def
example_long_prompts
()
->
List
[
str
]:
prompts
=
[]
for
filename
in
_LONG_PROMPTS
:
prompts
+=
_read_prompts
(
os
.
path
.
join
(
"tests"
,
filename
)
)
prompts
+=
_read_prompts
(
filename
)
return
prompts
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment