-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* test example scripts in ci * specify pool size * smaller batch size * try scifact * try smaller partitions * use max length from model * smaller partition num
- Loading branch information
Showing
3 changed files
with
56 additions
and
2 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import os | ||
import runpy | ||
import shutil | ||
import sys | ||
import tempfile | ||
|
||
import pytest | ||
|
||
examples_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "..", "examples") | ||
|
||
|
||
@pytest.mark.singlegpu | ||
@pytest.mark.parametrize( | ||
"script", | ||
[ | ||
"beir_report.py", | ||
], | ||
) | ||
def test_script_execution(script): | ||
path = os.path.join(examples_dir, script) | ||
orig_sys_argv = sys.argv | ||
|
||
with tempfile.TemporaryDirectory() as tmpdir: | ||
tmp_path = os.path.join(tmpdir, script) | ||
shutil.copy2(path, tmp_path) | ||
# argv[0] will be replaced by runpy | ||
sys.argv = [ | ||
"", | ||
"--overwrite", | ||
"--num-workers", | ||
"1", | ||
"--dataset", | ||
"fiqa", | ||
"--pool-size", | ||
"12GB", | ||
"--batch-size", | ||
"8", | ||
"--partition-num", | ||
"100", | ||
] | ||
runpy.run_path( | ||
tmp_path, | ||
run_name="__main__", | ||
) | ||
|
||
sys.argv = orig_sys_argv |